mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 07:04:17 +00:00
home-manager: fix early exit due to FQDN error
Since 89670e27e1
, FQDN lookup errors
from `hostname -f` may cause an early exit of the whole program.
This commit fixes the problem by absorbing the FQDN query inside the
`if` statement.
This commit is contained in:
parent
da8406a6ff
commit
2b1957a0a3
1 changed files with 1 additions and 2 deletions
|
@ -202,8 +202,7 @@ function setFlakeAttribute() {
|
|||
local hostnameArray=()
|
||||
# FQDN lookup can fail depending on the resolver.
|
||||
local fqdn
|
||||
fqdn="$(hostname -f 2> /dev/null)"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
if fqdn="$(hostname -f 2> /dev/null)"; then
|
||||
hostnameArray+=( "$USER@$fqdn" )
|
||||
fi
|
||||
# Check FQDN, long, and short hostnames; long first to preserve
|
||||
|
|
Loading…
Reference in a new issue