4 if [ "x$new_domain_name" != x
] && [ x
"$new_domain_name_servers" != x
]; then
5 echo search
$new_domain_name >/etc
/resolv.conf
6 for nameserver
in $new_domain_name_servers; do
7 echo nameserver
$nameserver >>/etc
/resolv.conf
12 # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
15 if [ -f /etc
/dhclient-exit-hooks
]; then
16 .
/etc
/dhclient-exit-hooks
18 # probably should do something with exit status of the local script
22 # Invoke the local dhcp client enter hooks, if they exist.
23 if [ -f /etc
/dhclient-enter-hooks
]; then
25 .
/etc
/dhclient-enter-hooks
26 # allow the local script to abort processing of this state
27 # local script must set exit_status variable to nonzero.
28 if [ $exit_status -ne 0 ]; then
33 if [ x
$new_broadcast_address != x
]; then
34 new_broadcast_arg
="broadcast $new_broadcast_address"
36 if [ x
$old_broadcast_address != x
]; then
37 old_broadcast_arg
="broadcast $old_broadcast_address"
39 if [ x
$new_subnet_mask != x
]; then
40 new_netmask_arg
="netmask $new_subnet_mask"
42 if [ x
$old_subnet_mask != x
]; then
43 old_netmask_arg
="netmask $old_subnet_mask"
45 if [ x
$alias_subnet_mask != x
]; then
46 alias_subnet_arg
="netmask $alias_subnet_mask"
49 ifconfig
=/sbin
/ifconfig
52 release
=`expr $release : '\(.*\)\..*'`
53 relmajor
=`echo $release |sed -e 's/^\([^\.]*\)\..*$/\1/'`
54 relminor
=`echo $release |sed -e 's/^.*\.\([^\.]*\)$/\1/'`
56 if [ x
$reason = xMEDIUM
]; then
57 eval "$ifconfig $interface $medium"
63 if [ x
$reason = xPREINIT
]; then
64 if [ x
$alias_ip_address != x
]; then
65 $ifconfig ${interface}:1 0 down
> /dev
/null
2>&1
66 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
68 if [ $relmajor -gt 5 ] ||
( [ $relmajor -eq 5 ] && [ $relminor -ge 5 ] )
70 # Turn the interface on
71 $ifconfig $interface plumb
72 $ifconfig $interface up
74 $ifconfig $interface inet
0.0.0.0 netmask
0.0.0.0 \
75 broadcast
255.255.255.255 up
80 if [ x
$reason = xARPCHECK
] ||
[ x
$reason = xARPSEND
]; then
84 if [ x
$reason = xBOUND
] ||
[ x
$reason = xRENEW
] || \
85 [ x
$reason = xREBIND
] ||
[ x
$reason = xREBOOT
]; then
86 current_hostname
=`hostname`
87 if [ x
$current_hostname = x
] || \
88 [ x
$current_hostname = x
$old_host_name ]; then
89 if [ x
$current_hostname = x
] || \
90 [ x
$new_host_name != x
$old_host_name ]; then
91 hostname
$new_host_name
95 if [ x
$old_ip_address != x
] && [ x
$alias_ip_address != x
] && \
96 [ x
$alias_ip_address != x
$old_ip_address ]; then
97 $ifconfig ${interface}:1 inet
0 down
> /dev
/null
2>&1
98 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
100 if [ x
$old_ip_address != x
] && [ x
$old_ip_address != x
$new_ip_address ]; then
101 $ifconfig ${interface} inet
0 down
102 route delete
$old_ip_address 127.1 >/dev
/null
2>&1
103 for router
in $old_routers; do
104 route delete default
$router >/dev
/null
2>&1
107 if [ x
$old_ip_address = x
] ||
[ x
$old_ip_address != x
$new_ip_address ] || \
108 [ x
$reason = xBOUND
] ||
[ x
$reason = xREBOOT
]; then
109 eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
110 $new_broadcast_arg $medium"
111 route add
$new_ip_address 127.1 1 >/dev
/null
2>&1
112 for router
in $new_routers; do
113 route add default
$router 1 >/dev
/null
2>&1
116 if [ x
$new_ip_address != x
$alias_ip_address ] && [ x
$alias_ip_address != x
];
118 $ifconfig ${interface}:1 inet
$alias_ip_address $alias_subnet_arg
119 route add
$alias_ip_address 127.0.0.1 1
125 if [ x
$reason = xEXPIRE
] ||
[ x
$reason = xFAIL
] ||
[ x
$reason = xRELEASE
] \
126 ||
[ x
$reason = xSTOP
]; then
127 if [ x
$alias_ip_address != x
]; then
128 $ifconfig ${interface}:1 0 down
> /dev
/null
2>&1
129 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
131 if [ x
$old_ip_address != x
]; then
132 $ifconfig $interface inet
0 down
133 route delete
$old_ip_address 127.1 >/dev
/null
2>&1
134 for router
in $old_routers; do
135 route delete default
$router >/dev
/null
2>&1
138 if [ x
$alias_ip_address != x
]; then
139 $ifconfig ${interface}:1 inet
$alias_ip_address $alias_subnet_arg
140 route add
$alias_ip_address 127.0.0.1 1
145 if [ x
$reason = xTIMEOUT
]; then
146 if [ x
$alias_ip_address != x
]; then
147 $ifconfig ${interface}:1 0 down
> /dev
/null
2>&1
148 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
150 eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
151 $new_broadcast_arg $medium"
154 if ping -s -n -I 1 $1 64 1; then
155 if [ x
$new_ip_address != x
$alias_ip_address ] && \
156 [ x
$alias_ip_address != x
]; then
157 $ifconfig ${interface}:1 inet
$alias_ip_address $alias_subnet_arg
158 route add
$alias_ip_address 127.0.0.1 1
160 route add
$new_ip_address 127.1 1 >/dev
/null
2>&1
161 for router
in $new_routers; do
162 route add default
$router 1 >/dev
/null
2>&1
167 $ifconfig $interface inet
0 down
168 for router
in $old_routers; do
169 route delete default
$router >/dev
/null
2>&1