Ensure that wifi interface is set in config file

This commit is contained in:
Bob Mottram 2016-10-21 10:31:53 +01:00
parent 0c569eff66
commit dfd4573ddc
2 changed files with 6 additions and 0 deletions

View File

@ -371,8 +371,10 @@ function create_networks_interactive {
update_wifi_adaptors
if [ ! $IFACE ]; then
# Don't try to configure wifi if there are no adaptors
remove_config_param "WIFI_INTERFACE"
return
fi
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
if [ -f $WIFI_NETWORKS_FILE ]; then
rm $WIFI_NETWORKS_FILE

View File

@ -50,6 +50,7 @@ WIFI_DISABLE=
IFACE=
IFACE_SECONDARY=
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-config
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-wifi
function show_help {
@ -83,6 +84,7 @@ do
shift
WIFI_INTERFACE=${1}
wifi_interface_specified=1
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
;;
-t|--type)
shift
@ -137,10 +139,12 @@ if [ ! $wifi_interface_specified= ]; then
exit 872356
fi
WIFI_INTERFACE=$IFACE
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
fi
if [ $WIFI_DISABLE ]; then
disable_wifi $WIFI_DISABLE
remove_config_param "WIFI_INTERFACE"
exit 0
fi