diff options
author | Ted Lemon <source@isc.org> | 2000-09-20 09:38:07 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-09-20 09:38:07 +0000 |
commit | cad0776d65530f70c7b0580020fc530b94638f7e (patch) | |
tree | 74060236d809b7c4c770f43856f69b2bfa9d169a /client/scripts | |
parent | db6960a7fa0c7e87ceeae09d0c54bbec0b2e3f10 (diff) | |
download | isc-dhcp-cad0776d65530f70c7b0580020fc530b94638f7e.tar.gz |
Use make_resolv_conf as documented.
Diffstat (limited to 'client/scripts')
-rwxr-xr-x | client/scripts/bsdos | 14 | ||||
-rwxr-xr-x | client/scripts/freebsd | 14 | ||||
-rwxr-xr-x | client/scripts/linux | 21 | ||||
-rw-r--r-- | client/scripts/openbsd | 14 | ||||
-rwxr-xr-x | client/scripts/solaris | 14 |
5 files changed, 17 insertions, 60 deletions
diff --git a/client/scripts/bsdos b/client/scripts/bsdos index e6d0e2a0..0c38205d 100755 --- a/client/scripts/bsdos +++ b/client/scripts/bsdos @@ -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 diff --git a/client/scripts/freebsd b/client/scripts/freebsd index a095c12f..877c2610 100755 --- a/client/scripts/freebsd +++ b/client/scripts/freebsd @@ -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 diff --git a/client/scripts/linux b/client/scripts/linux index b9d5884e..620efd51 100755 --- a/client/scripts/linux +++ b/client/scripts/linux @@ -22,6 +22,13 @@ # 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 diff --git a/client/scripts/openbsd b/client/scripts/openbsd index e6d0e2a0..0c38205d 100644 --- a/client/scripts/openbsd +++ b/client/scripts/openbsd @@ -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 diff --git a/client/scripts/solaris b/client/scripts/solaris index 12a344c6..117532f6 100755 --- a/client/scripts/solaris +++ b/client/scripts/solaris @@ -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 |