diff options
Diffstat (limited to 'hooks/29-lookup-hostname')
| -rw-r--r-- | hooks/29-lookup-hostname | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hooks/29-lookup-hostname b/hooks/29-lookup-hostname index 811c7a9c89bf..a1540dd98340 100644 --- a/hooks/29-lookup-hostname +++ b/hooks/29-lookup-hostname @@ -4,20 +4,20 @@ lookup_hostname() { [ -z "$new_ip_address" ] && return 1 # Silly ISC programs love to send error text to stdout - if type dig >/dev/null 2>&1; then + if command -v dig >/dev/null 2>&1; then h=$(dig +short -x $new_ip_address) if [ $? = 0 ]; then echo "$h" | sed 's/\.$//' return 0 fi - elif type host >/dev/null 2>&1; then + elif command -v host >/dev/null 2>&1; then h=$(host $new_ip_address) if [ $? = 0 ]; then echo "$h" \ | sed 's/.* domain name pointer \(.*\)./\1/' return 0 fi - elif type getent >/dev/null 2>&1; then + elif command -v getent >/dev/null 2>&1; then h=$(getent hosts $new_ip_address) if [ $? = 0 ]; then echo "$h" | sed 's/[^ ]* *\([^ ]*\).*/\1/' |
