]>
git.ipfire.org Git - thirdparty/dhcp.git/blob - client/scripts/solaris
4 if [ x
"$new_domain_name_servers" != x
]; then
5 cat /dev
/null
> /etc
/resolv.conf.dhclient
6 if [ x
"$new_domain_search" != x
]; then
7 echo search
$new_domain_search >> /etc
/resolv.conf.dhclient
8 elif [ x
"$new_domain_name" != x
]; then
9 # Note that the DHCP 'Domain Name Option' is really just a domain
10 # name, and that this practice of using the domain name option as
11 # a search path is both nonstandard and deprecated.
12 echo search
$new_domain_name >> /etc
/resolv.conf.dhclient
14 for nameserver
in $new_domain_name_servers; do
15 echo nameserver
$nameserver >>/etc
/resolv.conf.dhclient
18 mv /etc
/resolv.conf.dhclient
/etc
/resolv.conf
22 # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
25 if [ -f /etc
/dhclient-exit-hooks
]; then
26 .
/etc
/dhclient-exit-hooks
28 # probably should do something with exit status of the local script
32 # Invoke the local dhcp client enter hooks, if they exist.
33 if [ -f /etc
/dhclient-enter-hooks
]; then
35 .
/etc
/dhclient-enter-hooks
36 # allow the local script to abort processing of this state
37 # local script must set exit_status variable to nonzero.
38 if [ $exit_status -ne 0 ]; then
43 if [ x
$new_broadcast_address != x
]; then
44 new_broadcast_arg
="broadcast $new_broadcast_address"
46 if [ x
$old_broadcast_address != x
]; then
47 old_broadcast_arg
="broadcast $old_broadcast_address"
49 if [ x
$new_subnet_mask != x
]; then
50 new_netmask_arg
="netmask $new_subnet_mask"
52 if [ x
$old_subnet_mask != x
]; then
53 old_netmask_arg
="netmask $old_subnet_mask"
55 if [ x
$alias_subnet_mask != x
]; then
56 alias_subnet_arg
="netmask $alias_subnet_mask"
59 ifconfig
=/sbin
/ifconfig
62 release
=`expr $release : '\(.*\)\..*'`
63 relmajor
=`echo $release |sed -e 's/^\([^\.]*\)\..*$/\1/'`
64 relminor
=`echo $release |sed -e 's/^.*\.\([^\.]*\)$/\1/'`
66 if [ x
$reason = xMEDIUM
]; then
67 eval "$ifconfig $interface $medium"
73 if [ x
$reason = xPREINIT
]; then
74 if [ x
$alias_ip_address != x
]; then
75 $ifconfig ${interface}:1 0 down
> /dev
/null
2>&1
76 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
78 if [ $relmajor -gt 5 ] ||
( [ $relmajor -eq 5 ] && [ $relminor -ge 5 ] )
80 # Turn the interface on
81 $ifconfig $interface plumb
82 $ifconfig $interface up
84 $ifconfig $interface inet
0.0.0.0 netmask
0.0.0.0 \
85 broadcast
255.255.255.255 up
90 if [ x
$reason = xARPCHECK
] ||
[ x
$reason = xARPSEND
]; then
94 if [ x
$reason = xBOUND
] ||
[ x
$reason = xRENEW
] || \
95 [ x
$reason = xREBIND
] ||
[ x
$reason = xREBOOT
]; then
96 current_hostname
=`hostname`
97 if [ x
$current_hostname = x
] || \
98 [ x
$current_hostname = x
$old_host_name ]; then
99 if [ x
$current_hostname = x
] || \
100 [ x
$new_host_name != x
$old_host_name ]; then
101 hostname
$new_host_name
105 if [ x
$old_ip_address != x
] && [ x
$alias_ip_address != x
] && \
106 [ x
$alias_ip_address != x
$old_ip_address ]; then
107 $ifconfig ${interface}:1 inet
0 down
> /dev
/null
2>&1
108 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
110 if [ x
$old_ip_address != x
] && [ x
$old_ip_address != x
$new_ip_address ]; then
111 $ifconfig ${interface} inet
0 down
112 route delete
$old_ip_address 127.1 >/dev
/null
2>&1
113 for router
in $old_routers; do
114 route delete default
$router >/dev
/null
2>&1
117 if [ x
$old_ip_address = x
] ||
[ x
$old_ip_address != x
$new_ip_address ] || \
118 [ x
$reason = xBOUND
] ||
[ x
$reason = xREBOOT
]; then
119 eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
120 $new_broadcast_arg $medium"
121 route add
$new_ip_address 127.1 1 >/dev
/null
2>&1
122 for router
in $new_routers; do
123 route add default
$router 1 >/dev
/null
2>&1
126 if [ x
$new_ip_address != x
$alias_ip_address ] && [ x
$alias_ip_address != x
];
128 $ifconfig ${interface}:1 inet
$alias_ip_address $alias_subnet_arg
129 route add
$alias_ip_address 127.0.0.1 1
135 if [ x
$reason = xEXPIRE
] ||
[ x
$reason = xFAIL
] ||
[ x
$reason = xRELEASE
] \
136 ||
[ x
$reason = xSTOP
]; then
137 if [ x
$alias_ip_address != x
]; then
138 $ifconfig ${interface}:1 0 down
> /dev
/null
2>&1
139 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
141 if [ x
$old_ip_address != x
]; then
142 $ifconfig $interface inet
0 down
143 route delete
$old_ip_address 127.1 >/dev
/null
2>&1
144 for router
in $old_routers; do
145 route delete default
$router >/dev
/null
2>&1
148 if [ x
$alias_ip_address != x
]; then
149 $ifconfig ${interface}:1 inet
$alias_ip_address $alias_subnet_arg
150 route add
$alias_ip_address 127.0.0.1 1
155 if [ x
$reason = xTIMEOUT
]; then
156 if [ x
$alias_ip_address != x
]; then
157 $ifconfig ${interface}:1 0 down
> /dev
/null
2>&1
158 route delete
$alias_ip_address 127.0.0.1 > /dev
/null
2>&1
160 eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
161 $new_broadcast_arg $medium"
164 if ping -s -n -I 1 $1 64 1; then
165 if [ x
$new_ip_address != x
$alias_ip_address ] && \
166 [ x
$alias_ip_address != x
]; then
167 $ifconfig ${interface}:1 inet
$alias_ip_address $alias_subnet_arg
168 route add
$alias_ip_address 127.0.0.1 1
170 route add
$new_ip_address 127.1 1 >/dev
/null
2>&1
171 for router
in $new_routers; do
172 route add default
$router 1 >/dev
/null
2>&1
177 $ifconfig $interface inet
0 down
178 for router
in $old_routers; do
179 route delete default
$router >/dev
/null
2>&1