Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / dhcp / client / scripts / nextstep
blob7600fb145c54cdba8b376e3be703da2569525049
1 #!/bin/sh
3 # simplified dhclient-script for NeXTSTEP/OPENSTEP
5 # removed a lot of the cruft from the netbsd version since NeXTSTEP doesn't
6 # support aliases and lots of things were breaking for no good reason
8 # 14 Sep 1997, David W. Young
10 if [ x$reason = xPREINIT ]; then
11 ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 up >/dev/null 2>&1
12 exit 0
14 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
15 [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
16 current_hostname=`hostname`
17 if [ x$current_hostname = x ] || \
18 [ x$current_hostname = x$old_host_name ]; then
19 if [ x$current_hostname = x ] || \
20 [ x$new_host_name != x$old_host_name ]; then
21 hostname $new_host_name
25 if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
26 then
27 ifconfig $interface $new_ip_address netmask $new_subnet_mask \
28 >/dev/null 2>&1
29 route add $new_ip_address 127.1 0 >/dev/null 2>&1
30 for router in $new_routers ; do
31 route add default $router 1 >/dev/null 2>&1
32 done
34 if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
35 echo search $new_domain_name >/etc/resolv.conf
36 for nameserver in $new_domain_name_servers; do
37 echo nameserver $nameserver >>/etc/resolv.conf
38 done
40 exit 0
42 if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
43 || [ x$reason = xSTOP ]; then
44 if [ x$old_ip_address != x ]; then
45 route delete $old_ip_address 127.1 >/dev/null 2>&1
46 for $router in $old_routers ; do
47 route delete default $router >/dev/null 2>&1
48 done
50 exit 0