From: Harald Hoyer Date: Mon, 9 Mar 2009 11:49:17 +0000 (+0100) Subject: add full patch to /sbin/ip and check for dhclient $pid before kill X-Git-Tag: 0.1~290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5f9bfee2dc4a93ae042a91c1984971424bbfbec;p=thirdparty%2Fdracut.git add full patch to /sbin/ip and check for dhclient $pid before kill --- diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script index dc2d9e1e1..103e5f0aa 100755 --- a/modules.d/40network/dhclient-script +++ b/modules.d/40network/dhclient-script @@ -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 diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index 3878c416c..067bdf582 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -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 \ No newline at end of file +done diff --git a/modules.d/40network/kill-dhclient.sh b/modules.d/40network/kill-dhclient.sh index 3dd3b4317..d519013df 100755 --- a/modules.d/40network/kill-dhclient.sh +++ b/modules.d/40network/kill-dhclient.sh @@ -1,2 +1,4 @@ #!/bin/sh -kill $(pidof dhclient) \ No newline at end of file + +pid=$(pidof dhclient) +[[ $pid ]] && kill $pid