Only write wifi interface if parameters are given

This commit is contained in:
Bob Mottram 2016-10-21 10:33:40 +01:00
parent dfd4573ddc
commit 119bd00f7b
1 changed files with 3 additions and 2 deletions

View File

@ -368,13 +368,12 @@ function networks_from_file {
}
function create_networks_interactive {
remove_config_param "WIFI_INTERFACE"
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
@ -433,9 +432,11 @@ function create_networks_interactive {
if [ ${#WIFI_SSID} -gt 1 ]; then
if [ ${#WIFI_TYPE} -gt 1 ]; then
if [[ "${WIFI_TYPE}" == $'none' || "${WIFI_TYPE}" == $'open' ]]; then
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
return
else
if [ ${#WIFI_PASSPHRASE} -gt 1 ]; then
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
return
fi
fi