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
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