Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a script to retrieve the current default domain name.
  • Loading branch information
jedisct1 committed Aug 7, 2012
1 parent a2931c9 commit 813c578
Showing 1 changed file with 16 additions and 0 deletions.
@@ -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"

0 comments on commit 813c578

Please sign in to comment.