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_network_number != x
]; then
34 echo New Network Number
: $new_network_number
37 if [ x
$new_broadcast_address != x
]; then
38 echo New Broadcast Address
: $new_broadcast_address
39 new_broadcast_arg
="broadcast $new_broadcast_address"
41 if [ x
$old_broadcast_address != x
]; then
42 old_broadcast_arg
="broadcast $old_broadcast_address"
44 if [ x
$new_subnet_mask != x
]; then
45 new_netmask_arg
="netmask $new_subnet_mask"
47 if [ x
$old_subnet_mask != x
]; then
48 old_netmask_arg
="netmask $old_subnet_mask"
50 if [ x
$alias_subnet_mask != x
]; then
51 alias_subnet_arg
="netmask $alias_subnet_mask"
54 if [ x
$reason = xMEDIUM
]; then
55 eval "ifconfig $interface $medium"
56 eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev
/null
2>&1
61 if [ x
$reason = xPREINIT
]; then
62 if [ x
$alias_ip_address != x
]; then
63 ifconfig
$interface inet
-alias $alias_ip_address > /dev
/null
2>&1
64 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
66 ifconfig
$interface inet
0.0.0.0 netmask
0.0.0.0 \
67 broadcast
255.255.255.255 up
71 if [ x
$reason = xARPCHECK
] ||
[ x
$reason = xARPSEND
]; then
75 if [ x
$reason = xBOUND
] ||
[ x
$reason = xRENEW
] || \
76 [ x
$reason = xREBIND
] ||
[ x
$reason = xREBOOT
]; then
77 current_hostname
=`hostname`
78 if [ x
$current_hostname = x
] || \
79 [ x
$current_hostname = x
$old_host_name ]; then
80 if [ x
$current_hostname = x
] || \
81 [ x
$new_host_name != x
$old_host_name ]; then
82 hostname
$new_host_name
86 if [ x
$old_ip_address != x
] && [ x
$alias_ip_address != x
] && \
87 [ x
$alias_ip_address != x
$old_ip_address ]; then
88 ifconfig
$interface inet
-alias $alias_ip_address > /dev
/null
2>&1
89 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
91 if [ x
$old_ip_address != x
] && [ x
$old_ip_address != x
$new_ip_address ]
93 eval "ifconfig $interface inet -alias $old_ip_address $medium"
94 route delete
$old_ip_address 127.1 >/dev
/null
2>&1
95 for router
in $old_routers; do
96 route delete default
$router >/dev
/null
2>&1
98 if [ "$old_static_routes" != "" ]; then
99 set $old_static_routes
100 while [ $# -gt 1 ]; do
105 arp
-n -a |
sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' |sh
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 >/dev
/null
2>&1
112 for router
in $new_routers; do
113 route add default
$router >/dev
/null
2>&1
115 if [ "$new_static_routes" != "" ]; then
116 set $new_static_routes
117 while [ $# -gt 1 ]; do
123 if [ x
$new_ip_address != x
$alias_ip_address ] && [ x
$alias_ip_address != x
];
125 ifconfig
$interface inet
alias $alias_ip_address $alias_subnet_arg
126 route add
$alias_ip_address 127.0.0.1
132 if [ x
$reason = xEXPIRE
] ||
[ x
$reason = xFAIL
] ||
[ x
$reason = xRELEASE
] \
133 ||
[ x
$reason = xSTOP
]; then
134 if [ x
$alias_ip_address != x
]; then
135 ifconfig
$interface inet
-alias $alias_ip_address > /dev
/null
2>&1
136 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
138 if [ x
$old_ip_address != x
]; then
139 eval "ifconfig $interface inet -alias $old_ip_address $medium"
140 route delete
$old_ip_address 127.1 >/dev
/null
2>&1
141 for router
in $old_routers; do
142 route delete default
$router >/dev
/null
2>&1
144 if [ "$old_static_routes" != "" ]; then
145 set $old_static_routes
146 while [ $# -gt 1 ]; do
151 arp
-n -a |
sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \
154 if [ x
$alias_ip_address != x
]; then
155 ifconfig
$interface inet
alias $alias_ip_address $alias_subnet_arg
156 route add
$alias_ip_address 127.0.0.1
161 if [ x
$reason = xTIMEOUT
]; then
162 if [ x
$alias_ip_address != x
]; then
163 ifconfig
$interface inet
-alias $alias_ip_address > /dev
/null
2>&1
164 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
166 eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
167 $new_broadcast_arg $medium"
169 if [ "$new_routers" != "" ]; then
171 if ping -q -c 1 -w 1 $1; then
172 if [ x
$new_ip_address != x
$alias_ip_address ] && \
173 [ x
$alias_ip_address != x
]; then
174 ifconfig
$interface inet
alias $alias_ip_address $alias_subnet_arg
175 route add
$alias_ip_address 127.0.0.1
177 route add
$new_ip_address 127.1 >/dev
/null
2>&1
178 for router
in $new_routers; do
179 route add default
$router >/dev
/null
2>&1
181 set $new_static_routes
182 while [ $# -gt 1 ]; do
190 eval "ifconfig $interface inet -alias $new_ip_address $medium"
191 for router
in $old_routers; do
192 route delete default
$router >/dev
/null
2>&1
194 if [ "$old_static_routes" != "" ]; then
195 set $old_static_routes
196 while [ $# -gt 1 ]; do
201 arp
-n -a |
sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \