Commit dd644a1f authored by Robby Russell's avatar Robby Russell
Browse files

Merge pull request #2743 from docwhat/issue-2155-scutil

Trust but verify 'scutil' to return ComputerName
parents ca0331da 00b21d5a
......@@ -38,9 +38,9 @@ for plugin ($plugins); do
done
# Figure out the SHORT hostname
if [ -n "$commands[scutil]" ]; then
# OS X
SHORT_HOST=$(scutil --get ComputerName)
if [[ "$OSTYPE" = darwin* ]]; then
# OS X's $HOST changes with dhcp, etc. Use ComputerName if possible.
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
else
SHORT_HOST=${HOST/.*/}
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment