X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Fbootscripts%2Fifdown;h=a6fabf994b52a163539f2d3f9c7c2024c4128a18;hb=e8cc14e96c051666130d201fa5c60291a881e008;hp=115c4880a8f22a0d9ae0d797de80639a4993618f;hpb=a348576b5f215c87cf471d4340713e0773f4edf8;p=hvlinux.git diff --git a/stage2/bootscripts/ifdown b/stage2/bootscripts/ifdown index 115c488..a6fabf9 100755 --- a/stage2/bootscripts/ifdown +++ b/stage2/bootscripts/ifdown @@ -24,14 +24,13 @@ check_brctl() } # First make sure interface is available -if ! ip link show ${DEVICE} ; then +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" ]; then +if [ "x${BOOTPROTO}" = "xdhcp" -o "x${BOOTPROTO}" = "xwifi" ]; then # DHCP configuration - # Load DHCP client parameters source /etc/sysconfig/network/dhcp-client @@ -42,17 +41,21 @@ 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 + 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