]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Use make_resolv_conf as documented.
authorTed Lemon <source@isc.org>
Wed, 20 Sep 2000 09:38:07 +0000 (09:38 +0000)
committerTed Lemon <source@isc.org>
Wed, 20 Sep 2000 09:38:07 +0000 (09:38 +0000)
client/scripts/bsdos
client/scripts/freebsd
client/scripts/linux
client/scripts/openbsd
client/scripts/solaris

index e6d0e2a0a3db1f3346a43afda676d2dfae93f0ba..0c38205d0dc4ed25799937d77b4c911a64c61e2c 100755 (executable)
@@ -123,10 +123,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
     ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
     route add $alias_ip_address 127.0.0.1
   fi
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  make_resolv_conf
   exit_with_hooks 0
 fi
 
@@ -183,14 +180,7 @@ if [ x$reason = xTIMEOUT ]; then
        route add $0 $1
        shift; shift
       done
-      echo search $new_domain_name >/etc/resolv.conf.std
-      for nameserver in $new_domain_name_servers; do
-       echo nameserver $nameserver >>/etc/resolv.conf.std
-      done
-      if [ -f /etc/resolv.conf ]; then
-       rm -f /etc/resolv.conf
-      fi
-      mv /etc/resolv.conf.std /etc/resolv.conf
+      make_resolv_conf
       exit_with_hooks 0
     fi
   fi
index a095c12fa232dcf3c7921636cd8ddbd4b26067fe..877c26103515393d6c59dfe8fd385845148c15be 100755 (executable)
@@ -122,10 +122,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
     ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
     route add $alias_ip_address 127.0.0.1
   fi
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  make_resolv_conf
   exit_with_hooks 0
 fi
 
@@ -182,14 +179,7 @@ if [ x$reason = xTIMEOUT ]; then
        route add $0 $1
        shift; shift
       done
-      echo search $new_domain_name >/etc/resolv.conf.std
-      for nameserver in $new_domain_name_servers; do
-       echo nameserver $nameserver >>/etc/resolv.conf.std
-      done
-      if [ -f /etc/resolv.conf ]; then
-       rm -f /etc/resolv.conf
-      fi
-      mv /etc/resolv.conf.std /etc/resolv.conf
+      make_resolv_conf
       exit_with_hooks 0
     fi
   fi
index b9d5884e17e790908c1d11c5118b3cbe1fb0414b..620efd51253b25582910669e9965b2526ccc891a 100755 (executable)
 # 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
 # of the $1 in its args.
 
+function make_resolv_conf() {
+  echo search $new_domain_name >/etc/resolv.conf
+  for nameserver in $new_domain_name_servers; do
+    echo nameserver $nameserver >>/etc/resolv.conf
+  done
+}
+
 # Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
 function exit_with_hooks() {
   exit_status=$1
@@ -136,10 +143,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
     ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
     route add -host $alias_ip_address $interface:0
   fi
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  make_resolv_conf
   exit_with_hooks 0
 fi
 
@@ -180,14 +184,7 @@ if [ x$reason = xTIMEOUT ]; then
     for router in $new_routers; do
       route add default gw $router
     done
-    echo search $new_domain_name >/etc/resolv.conf.std
-    for nameserver in $new_domain_name_servers; do
-      echo nameserver $nameserver >>/etc/resolv.conf.std
-    done
-    if [ -f /etc/resolv.conf ]; then
-      rm -f /etc/resolv.conf
-      ln /etc/resolv.conf.std /etc/resolv.conf
-    fi
+    make_resolv_conf
     exit_with_hooks 0
   fi
   ifconfig $interface inet down
index e6d0e2a0a3db1f3346a43afda676d2dfae93f0ba..0c38205d0dc4ed25799937d77b4c911a64c61e2c 100644 (file)
@@ -123,10 +123,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
     ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
     route add $alias_ip_address 127.0.0.1
   fi
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  make_resolv_conf
   exit_with_hooks 0
 fi
 
@@ -183,14 +180,7 @@ if [ x$reason = xTIMEOUT ]; then
        route add $0 $1
        shift; shift
       done
-      echo search $new_domain_name >/etc/resolv.conf.std
-      for nameserver in $new_domain_name_servers; do
-       echo nameserver $nameserver >>/etc/resolv.conf.std
-      done
-      if [ -f /etc/resolv.conf ]; then
-       rm -f /etc/resolv.conf
-      fi
-      mv /etc/resolv.conf.std /etc/resolv.conf
+      make_resolv_conf
       exit_with_hooks 0
     fi
   fi
index 12a344c6f6e72e69a01d018df2b08414df112637..117532f6b1c37b1038834dacdb718db6c58d0557 100755 (executable)
@@ -116,10 +116,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
     $ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg
     route add $alias_ip_address 127.0.0.1 1
   fi
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  make_resolv_conf
   exit_with_hooks 0
 fi
 
@@ -161,14 +158,7 @@ if [ x$reason = xTIMEOUT ]; then
     for router in $new_routers; do
       route add default $router 1 >/dev/null 2>&1
     done
-    echo search $new_domain_name >/etc/resolv.conf.std
-    for nameserver in $new_domain_name_servers; do
-      echo nameserver $nameserver >>/etc/resolv.conf.std
-    done
-    if [ -f /etc/resolv.conf ]; then
-      rm -f /etc/resolv.conf
-      ln /etc/resolv.conf.std /etc/resolv.conf
-    fi
+    make_resolv_conf
     exit_with_hooks 0
   fi
   $ifconfig $interface inet 0 down