aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-10-16 12:04:20 +0100
committerRoy Marples <roy@marples.name>2009-10-16 12:04:20 +0100
commitd27655c908b908e959687cbe31342c675ab6c043 (patch)
treed6f2cac787d449e97170ed593b6fad767074cab6
parent9f4a7afd83a313a8c69dd49fd44105cba7628e9a (diff)
Add domainname to the network script
-rw-r--r--conf.d/network.in2
-rw-r--r--init.d/network.in10
2 files changed, 12 insertions, 0 deletions
diff --git a/conf.d/network.in b/conf.d/network.in
index dc0f80c0..72019253 100644
--- a/conf.d/network.in
+++ b/conf.d/network.in
@@ -26,3 +26,5 @@
# If you require DHCP, you should install dhcpcd and it to the boot or
# default runlevel.
+# NIS users can set the domain name here
+#domainname="foobar"
diff --git a/init.d/network.in b/init.d/network.in
index 8233cc4f..5e609633 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -173,6 +173,16 @@ runargs()
start()
{
local cr=0 r= int= intv= cmd= args= upcmd=
+
+ if [ -z "$domainname" && -s /etc/defaultdomain ]; then
+ domainname=$(cat /etc/defaultdomain)
+ fi
+ if [ -n "$domainname" ]; then
+ ebegin "Setting NIS domainname: $domainname"
+ domainname "$domainname"
+ eend $?
+ fi
+
einfo "Starting network"
routeflush
if [ "$RC_UNAME" = "Linux" ]; then