Stop dhcpcd before starting if it was running

This commit is contained in:
Arne Fitzenreiter
2009-06-14 13:57:11 +02:00
parent f672f49ba2
commit 7e0cd11d13

View File

@@ -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