Add a script to retrieve the current default domain name.

This commit is contained in:
Frank Denis
2012-08-06 17:10:19 -07:00
parent a2931c9c59
commit 813c57887f
@@ -0,0 +1,16 @@
#! /bin/ksh
. ./common.inc
[ -r /etc/resolv.conf ] || exit 0
domain=""
while read line; do
case "$line" in
domain\ *)
domain=$(echo "$line" | sed -e 's/domain *//' -e 's/ *//')
break
;;
esac
done < /etc/resolv.conf
echo "$domain"