Add a script to retrieve the current default domain name.
This commit is contained in:
+16
@@ -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"
|
||||
Reference in New Issue
Block a user