X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Fbootscripts%2Fifdown;h=3634b36de1396368266abd792ac45287d66d871b;hb=727c462da1a14421a7ace1978f03f659124d9418;hp=52a20df3b01e757b0b06647585555cc84a1bdd20;hpb=f9cf3632a64429991fa5e6f556b0c4017e0e9435;p=hvlinux.git diff --git a/stage2/bootscripts/ifdown b/stage2/bootscripts/ifdown index 52a20df..3634b36 100755 --- a/stage2/bootscripts/ifdown +++ b/stage2/bootscripts/ifdown @@ -23,9 +23,14 @@ check_brctl() fi } -if [ "x${BOOTPROTO}" = "xdhcp" ]; then - # DHCP configuration +# First make sure interface is available +if ! ip link show ${DEVICE} 1> /dev/null 2>&1 ; then + echo "Interface ${DEVICE} not available" + exit ${EXIT_CODE_WARNING} +fi +if [ "x${BOOTPROTO}" = "xdhcp" -o "x${BOOTPROTO}" = "xwifi" ]; then + # DHCP configuration # Load DHCP client parameters source /etc/sysconfig/network/dhcp-client @@ -36,17 +41,22 @@ if [ "x${BOOTPROTO}" = "xdhcp" ]; then cmd_run_log ${DHCP_PROG} ${DHCP_STOP} ${DEVICE} || exit ${EXIT_CODE_FAILURE} elif [ x${BOOTPROTO} = "xstatic" ]; then # Static configuration - cmd_run_log ip addr flush ${DEVICE} && - cmd_run_log ip link set ${DEVICE} down || exit ${EXIT_CODE_FAILURE} + cmd_run_log ip addr flush ${DEVICE} || exit ${EXIT_CODE_FAILURE} elif [ x${BOOTPROTO} = "xpppoe" ]; then # PPPoE configuration cmd_run_log pppoe-stop - cmd_run_log ip addr flush ${DEVICE} && - cmd_run_log ip link set ${DEVICE} down || exit ${EXIT_CODE_FAILURE} + cmd_run_log ip addr flush ${DEVICE} || exit ${EXIT_CODE_FAILURE} else exit 1 fi +if [ "x${BOOTPROTO}" = "xwifi" ]; then + echo "Stopping wpa_supplicant" + killall wpa_supplicant +fi + +cmd_run_log ip link set ${DEVICE} down || exit ${EXIT_CODE_FAILURE} + # Determining if the interface is part of a bridge: if [ -n "${BRIDGE_TO}" ]; then check_brctl