add full patch to /sbin/ip and check for dhclient $pid before kill

master
Harald Hoyer 2009-03-09 12:49:17 +01:00
parent a96499538b
commit f5f9bfee2d
3 changed files with 12 additions and 10 deletions

View File

@ -3,13 +3,13 @@
# up, and it does not even try to do anything else.

case $reason in
PREINIT) ip link set "$interface" up ;;
PREINIT) /sbin/ip link set "$interface" up ;;
BOUND) ipopts="$new_ip_address"
[ "$new_interface_mtu" ] && ip link set $interface mtu $new_interface_mtu
[ "$new_subnet_mask" ] && ipopts="$ipopts/$new_subnet_mask"
[ "$new_broadcast_address" ] && ipopts="$ipopts broadcast $new_broadcast_address"
ip addr add $ipopts dev $interface
[ "$new_routers" ] && ip route add default via ${new_routers%%,*} dev $interface
/sbin/ip addr add $ipopts dev $interface
[ "$new_routers" ] && /sbin/ip route add default via ${new_routers%%,*} dev $interface
[ "$new_domain_name" ] && echo "domain $new_domain_name" > /etc/resolv.conf
if [ "$new_domain_search" ]; then
echo "search $new_domain_search" |sed 's/,//g' >> /etc/resolv.conf

View File

@ -5,8 +5,8 @@

# loopback is always handled the same way
[ "$1" = "lo" ] && {
ip link set lo up
ip addr add 127.0.0.1/8 dev lo
/sbin/ip link set lo up
/sbin/ip addr add 127.0.0.1/8 dev lo
exit 0
}

@ -24,13 +24,13 @@ for p in $(cat /proc/cmdline); do
case $autoconf in
dhcp|on|any) >/net.$1.dhcp ;;
none|off|'') # do some basic configuration
ip link set $1 up
ip addr add $client/$netmask dev $1
[ "$gw" ] && ip route add default via $gw dev $1
/sbin/ip link set $1 up
/sbin/ip addr add $client/$netmask dev $1
[ "$gw" ] && /sbin/ip route add default via $gw dev $1
>/net.$1.up ;;
esac
fi
) ;;
*) continue;;
esac
done
done

View File

@ -1,2 +1,4 @@
#!/bin/sh
kill $(pidof dhclient)

pid=$(pidof dhclient)
[[ $pid ]] && kill $pid