From d43bb759b1bb6d02a93b63d0dfd82e623685fb21 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Mon, 8 Jul 2013 22:32:42 +0200 Subject: [PATCH] functions.network: cleanup dhcp stop script. --- .../init.d/networking/functions.network | 49 ++++++++----------- src/initscripts/init.d/networking/red | 0 .../init.d/networking/wpa_supplicant.exe | 0 src/initscripts/init.d/wlanclient | 0 4 files changed, 20 insertions(+), 29 deletions(-) mode change 100755 => 100644 src/initscripts/init.d/networking/functions.network mode change 100755 => 100644 src/initscripts/init.d/networking/red mode change 100755 => 100644 src/initscripts/init.d/networking/wpa_supplicant.exe mode change 100755 => 100644 src/initscripts/init.d/wlanclient diff --git a/src/initscripts/init.d/networking/functions.network b/src/initscripts/init.d/networking/functions.network old mode 100755 new mode 100644 index b1ce220de..d52b30159 --- a/src/initscripts/init.d/networking/functions.network +++ b/src/initscripts/init.d/networking/functions.network @@ -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="$?" - - # 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 + # Stop dhcpcd. + /sbin/dhcpcd "${device}" "${dhcp_stop}" &> /dev/null + ret="$?" + + # 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 } diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red old mode 100755 new mode 100644 diff --git a/src/initscripts/init.d/networking/wpa_supplicant.exe b/src/initscripts/init.d/networking/wpa_supplicant.exe old mode 100755 new mode 100644 diff --git a/src/initscripts/init.d/wlanclient b/src/initscripts/init.d/wlanclient old mode 100755 new mode 100644 -- 2.39.2