mirror of
https://github.com/sheumann/hush.git
synced 2024-12-30 05:29:47 +00:00
1aee3ff8bb
Erik, Attached is a patch for the udhcpc sample scripts, to correct the order in which routers are applied if the DHCP server provides more than one (as per section 3.5 of RFC2132). Apologies for not being on the mailing list and thanks for your continued efforts. Simon.
31 lines
619 B
Bash
Executable File
31 lines
619 B
Bash
Executable File
#!/bin/sh
|
|
# Sample udhcpc bound script
|
|
|
|
RESOLV_CONF="/etc/udhcpc/resolv.conf"
|
|
|
|
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
|
|
[ -n "$subnet" ] && NETMASK="netmask $subnet"
|
|
|
|
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
|
|
|
|
if [ -n "$router" ]
|
|
then
|
|
echo "deleting routers"
|
|
while /sbin/route del default gw 0.0.0.0 dev $interface
|
|
do :
|
|
done
|
|
|
|
metric=0
|
|
for i in $router
|
|
do
|
|
/sbin/route add default gw $i dev $interface metric $((metric++))
|
|
done
|
|
fi
|
|
|
|
echo -n > $RESOLV_CONF
|
|
[ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
|
|
for i in $dns
|
|
do
|
|
echo adding dns $i
|
|
echo nameserver $i >> $RESOLV_CONF
|
|
done |