blob: 98f3aa97e9dc73e14752813c0236a6ea7cf0de3d [file] [log] [blame]
Glenn L McGrath419eed72002-08-21 14:24:38 +00001#!/bin/sh
2# Sample udhcpc renew script
3
4RESOLV_CONF="/etc/resolv.conf"
5
6[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
7[ -n "$subnet" ] && NETMASK="netmask $subnet"
8
9/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
10
11if [ -n "$router" ]
12then
13 echo "deleting routers"
14 while /sbin/route del default gw 0.0.0.0 dev $interface
15 do :
16 done
17
18 for i in $router
19 do
20 /sbin/route add default gw $i dev $interface
21 done
22fi
23
24echo -n > $RESOLV_CONF
25[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
26for i in $dns
27do
28 echo adding dns $i
29 echo nameserver $i >> $RESOLV_CONF
30done