+
+ if [ ! -d /etc/sysconfig/network/ssid ]; then
+ echo "Missing \"/etc/sysconfig/network/ssid\" directory"
+ exit ${EXIT_CODE_WARNING}
+ fi
+
+ # Warning:
+ # wpa_supplicant will connect to a given network SSID even if the case is incorrect
+ # (MyNetwork and MYNETWORK will work). But the ssid network file configuration
+ # case must match exactly what was returned by wpa_supplicant
+ if [ ! -f "/etc/sysconfig/network/ssid/${SSID}" ]; then
+ echo "${0}: Missing network configuration file \"/etc/sysconfig/network/ssid/${SSID}\""
+ exit ${EXIT_CODE_FAILURE}
+ fi
+
+ source "/etc/sysconfig/network/ssid/${SSID}"
+}
+
+# Make sure interface is available
+if [ ! -d /sys/class/net/${DEVICE} ]; then
+ echo "Interface ${DEVICE} not found"
+ exit ${EXIT_CODE_WARNING}
+fi
+
+# Determining if the interface is a bridge:
+if [ "x${BRIDGE}" = "xyes" ]; then
+ check_brctl
+ cmd_run_log ${BRCTL} addbr ${DEVICE} &&
+ cmd_run_log ${BRCTL} stp ${DEVICE} off || exit 1
+fi
+
+# Determining if the interface is part of a bridge:
+if [ -n "${BRIDGE_TO}" ]; then
+ check_brctl
+ cmd_run_log ${BRCTL} addif ${BRIDGE_TO} ${DEVICE} || exit 1
+fi
+
+if [ "x${BOOTPROTO}" = "xwifi" ]; then
+ proto_wireless
+ # At this point, the SSID script has been sourced, and its
+ # BOOTPROTO variable will contain either "static" or "dhcp",
+ # so configuration will continue below.
+fi
+
+if [ "x${BOOTPROTO}" = "xdhcp" ]; then
+ proto_dhcp
+elif [ "x${BOOTPROTO}" = "xstatic" ]; then
+ proto_static