From: Felix Fietkau Date: Wed, 7 Sep 2005 16:54:13 +0000 (+0000) Subject: make sure only one dhcp client is active for one interface X-Git-Tag: whiterussian_rc4~197 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=60a630f5a53f35b2d33f3bb34b1228e32a02a8ab;p=openwrt%2Fsvn-archive%2Fopenwrt.git make sure only one dhcp client is active for one interface SVN-Revision: 1872 --- diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh index dfbdb873f7..2bf4a8d998 100755 --- a/openwrt/package/base-files/default/etc/functions.sh +++ b/openwrt/package/base-files/default/etc/functions.sh @@ -66,7 +66,12 @@ do_ifup() { DHCP_HOSTNAME=${DHCP_HOSTNAME%%.*} [ -z $DHCP_HOSTNAME ] || DHCP_ARGS="$DHCP_ARGS -H $DHCP_HOSTNAME" [ "$if_proto" = "pptp" ] && DHCP_ARGS="$DHCP_ARGS -n -q" || DHCP_ARGS="$DHCP_ARGS -R &" + oldpid=$(cat $pidfile) ${DEBUG:-eval} "udhcpc $DHCP_ARGS" + pidof udhcpc | grep "$oldpid" >&- 2>&- && { + sleep 1 + kill -9 $oldpid + } ;; none|"") ;;