From dfd4573ddc8a89b1daf156cc929c3b197ea5325d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 21 Oct 2016 10:31:53 +0100 Subject: [PATCH] Ensure that wifi interface is set in config file --- src/freedombone-utils-wifi | 2 ++ src/freedombone-wifi | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index 4b6676c4..a9278973 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -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 diff --git a/src/freedombone-wifi b/src/freedombone-wifi index 2cdfcfa4..036c9d9c 100755 --- a/src/freedombone-wifi +++ b/src/freedombone-wifi @@ -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