forked from ungleich-public/cdist
[__hostname/explorer/hostname] Darwin: Always fall back to hostname if scutil is missing or fails
This commit is contained in:
parent
2804a8bae6
commit
abc765bd99
1 changed files with 2 additions and 2 deletions
|
@ -41,8 +41,8 @@ elif [ -f /etc/myname ]; then
|
||||||
elif [ "$(uname -s)" == FreeBSD ]; then
|
elif [ "$(uname -s)" == FreeBSD ]; then
|
||||||
(. /etc/rc.conf && echo $hostname)
|
(. /etc/rc.conf && echo $hostname)
|
||||||
# Mac OS X
|
# Mac OS X
|
||||||
elif [ "$(uname -s)" == Darwin -a -x "$(command -v scutil)" ]; then
|
elif [ "$(uname -s)" == Darwin ]; then
|
||||||
scutil --get HostName 2>/dev/null || hostname -s
|
[ -x "$(command -v scutil)" ] && scutil --get HostName 2>/dev/null || hostname -s
|
||||||
else
|
else
|
||||||
command -v hostname && hostname -s
|
command -v hostname && hostname -s
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue