iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
better doc for faiserver-disable
[automated-distro-installer]
/
chost
diff --git
a/chost
b/chost
index 9fa57d07db3e997ab955db6dfa6a12ca3327a81d..77e17d467b3447468c59b832efbd3da893e59b06 100755
(executable)
--- a/
chost
+++ b/
chost
@@
-7,8
+7,6
@@
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
host=$1
-addr=$(host $host)
-addr=${addr##* }
-h=$(host $addr)
-h=${h##* }
+addr=$(getent hosts $host | awk '{print $1}')
+h=$(getent hosts $addr | awk '{print $2}')
echo ${h%%.*}