mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Stop dhcpcd before starting if it was running
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user