mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
functions.network: cleanup dhcp stop script.
This commit is contained in:
45
src/initscripts/init.d/networking/functions.network
Executable file → Normal file
45
src/initscripts/init.d/networking/functions.network
Executable file → Normal file
@@ -123,34 +123,25 @@ dhcpcd_stop() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if we got a valid lease.
|
||||
if [ -e $leaseinfo ]; then
|
||||
. $leaseinfo
|
||||
if [ "$dchp_lease_time" = "4294967295" ]; then
|
||||
# do nothing, just echo ok
|
||||
echo_ok
|
||||
else
|
||||
# Stop dhcpcd.
|
||||
/sbin/dhcpcd "${device}" "${dhcp_stop}" &> /dev/null
|
||||
ret="$?"
|
||||
# Stop dhcpcd.
|
||||
/sbin/dhcpcd "${device}" "${dhcp_stop}" &> /dev/null
|
||||
ret="$?"
|
||||
|
||||
# Wait until dhcpd has stopped.
|
||||
while [ -d "/proc/${pid}" ]; do
|
||||
sleep 1
|
||||
done
|
||||
# Wait until dhcpd has stopped.
|
||||
while [ -d "/proc/${pid}" ]; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Display console message, depended on the exit code
|
||||
# of the stopped dhcpcd.
|
||||
if [ "${ret}" -eq 0 ]; then
|
||||
boot_mesg
|
||||
echo_ok
|
||||
elif [ "${ret}" -eq 1 ]; then
|
||||
boot_mesg "failed to stop dhcpcd!" ${WARNING}
|
||||
echo_warning
|
||||
else
|
||||
boot_mesg
|
||||
echo_failure
|
||||
fi
|
||||
fi
|
||||
# Display console message, depended on the exit code
|
||||
# of the stopped dhcpcd.
|
||||
if [ "${ret}" -eq 0 ]; then
|
||||
boot_mesg
|
||||
echo_ok
|
||||
elif [ "${ret}" -eq 1 ]; then
|
||||
boot_mesg "failed to stop dhcpcd!" ${WARNING}
|
||||
echo_warning
|
||||
else
|
||||
boot_mesg
|
||||
echo_failure
|
||||
fi
|
||||
}
|
||||
|
||||
0
src/initscripts/init.d/networking/red
Executable file → Normal file
0
src/initscripts/init.d/networking/red
Executable file → Normal file
0
src/initscripts/init.d/networking/wpa_supplicant.exe
Executable file → Normal file
0
src/initscripts/init.d/networking/wpa_supplicant.exe
Executable file → Normal file
0
src/initscripts/init.d/wlanclient
Executable file → Normal file
0
src/initscripts/init.d/wlanclient
Executable file → Normal file
Reference in New Issue
Block a user