add http server support for maru, small bug fixes
[automated-distro-installer] / chost
diff --git a/chost b/chost
index 3e1acd216f8cf5fe055641021c95844f7f53b070..616874151a0aa5c087c1c275198eb4134cbc530e 100755 (executable)
--- a/chost
+++ b/chost
@@ -7,7 +7,7 @@ set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 
 host=$1
-addr=$(host $host | sed -rn 's/^.*has address (.*)/\1/p;T;q')
+addr=$(host $host | sed -rn 's/^\S+ has address //p;T;q')
 h=$(host $addr)
 h=${h##* }
 echo ${h%%.*}