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
various changes for libreboot having no pxe
[automated-distro-installer]
/
chost
diff --git
a/chost
b/chost
index 9a0034f120db7e94ee0377f4f5b98c27ea19f4ce..3e1acd216f8cf5fe055641021c95844f7f53b070 100755
(executable)
--- a/
chost
+++ b/
chost
@@
-1,4
+1,5
@@
#!/bin/bash
#!/bin/bash
+# Copyright (C) 2016 Ian Kelling
# chost: get canonical hostname
# chost: get canonical hostname
@@
-6,8
+7,7
@@
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
host=$1
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
host=$1
-addr=$(host $host)
-addr=${addr##* }
+addr=$(host $host | sed -rn 's/^.*has address (.*)/\1/p;T;q')
h=$(host $addr)
h=${h##* }
echo ${h%%.*}
h=$(host $addr)
h=${h##* }
echo ${h%%.*}