mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01: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=()
|
local hostnameArray=()
|
||||||
# FQDN lookup can fail depending on the resolver.
|
# FQDN lookup can fail depending on the resolver.
|
||||||
local fqdn
|
local fqdn
|
||||||
fqdn="$(hostname -f 2> /dev/null)"
|
if fqdn="$(hostname -f 2> /dev/null)"; then
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
hostnameArray+=( "$USER@$fqdn" )
|
hostnameArray+=( "$USER@$fqdn" )
|
||||||
fi
|
fi
|
||||||
# Check FQDN, long, and short hostnames; long first to preserve
|
# Check FQDN, long, and short hostnames; long first to preserve
|
||||||
|
|
Loading…
Reference in a new issue