Subversion Repositories livecd

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 beyerle@PS 1
#!/bin/sh
2
 
3
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
4
 
5
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
6
 
7
RESOLV_CONF="/etc/resolv.conf"
8
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
9
[ -n "$subnet" ] && NETMASK="netmask $subnet"
10
 
11
case "$1" in
12
        deconfig)
13
                /sbin/ifconfig $interface 0.0.0.0
14
                ;;
15
 
16
        renew|bound)
17
                /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
18
 
19
                if [ -n "$router" ] ; then
20
                        echo "deleting routers"
108 beyerle@PS 21
                        while route del default gw 0.0.0.0 dev $interface 2>/dev/null; do
1 beyerle@PS 22
                                :
23
                        done
24
 
25
                        for i in $router ; do
26
                                route add default gw $i dev $interface
27
                        done
28
                fi
29
 
30
                echo -n > $RESOLV_CONF
31
                [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
32
                for i in $dns ; do
33
                        echo adding dns $i
34
                        echo nameserver $i >> $RESOLV_CONF
35
                done
36
                ;;
37
esac
38
 
39
exit 0