Gfx Stack Update
[nyanlinux.git] / files / nyandhcp
blob7700cdc72e08c4c8dafc18efa42d9efaaa45b142
1 #!/bin/sh
3 ip=/nyan/iproute2/current/sbin/ip
4 rm=/nyan/coreutils/current/bin/rm
6 if test $reason = PREINIT; then
7 $ip link set $interface down
8 $ip addr flush dev $interface
9 $ip link set $interface up
10 exit 0
13 # I'm not into it, but I guess RENEW and maybe REBIND do not need full
14 # reconfiguration of the network interface
15 if test $reason = BOUND -o $reason = RENEW -o $reason = REBIND -o $reason = REBOOT; then
16 $ip link set $interface down
17 $ip addr flush dev $interface
18 $ip addr add $new_ip_address/$new_subnet_mask broadcast $new_broadcast_address dev $interface
19 $ip link set $interface up
20 $ip route add default via $new_routers dev $interface
22 $rm -f /etc/resolv.conf
23 for n in $new_domain_name_servers
25 echo "nameserver $n" >>/etc/resolv.conf
26 done
27 exit 0
30 $ip link set $interface down
31 $ip addr flush dev $interface