From: Arne Fitzenreiter Date: Sun, 14 Jun 2009 11:57:11 +0000 (+0200) Subject: Stop dhcpcd before starting if it was running X-Git-Tag: v2.5-final~1 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=7e0cd11d132f2c79c4d7de4869a4f8c6a4c67474 Stop dhcpcd before starting if it was running --- diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index 6ac87aae36..6a85eb48e6 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -124,6 +124,35 @@ case "${1}" in run_subdir ${rc_base}/init.d/networking/red.up/ elif [ "${TYPE}" == "DHCP" ]; then + + if [ -e $LEASEINFO ]; then + boot_mesg -n "Stopping dhcpcd on the ${DEVICE} interface..." + . $LEASEINFO + if [ "$LEASETIME" = "4294967295" ]; then + # do nothing, just echo ok + echo "" + echo_ok + else + if [ -n "$DHCP_STOP" ]; then + /sbin/dhcpcd ${DEVICE} $DHCP_STOP &> /dev/null + RET="$?" + if [ "$RET" -eq 0 ]; then + echo "" + echo_ok + elif [ "$RET" -eq 1 ]; then + boot_mesg "dhcpcd not running!" ${WARNING} + echo_warning + else + echo "" + echo_failure + fi + else + echo "" + killproc dhcpcd + fi + fi + fi + boot_mesg -n "Starting dhcpcd on the ${DEVICE} interface..." echo -n "${DEVICE}" > /var/ipfire/red/iface