From 7d232bc866bc3a44a7be759b8c490d09a21ae898 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 22 Oct 2016 23:04:53 +0100 Subject: [PATCH] Enabling and disabling wifi --- src/freedombone-utils-wifi | 10 +++++++++- src/freedombone-wifi | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index 966b5e08..09d11d00 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -315,6 +315,13 @@ function wifi_store_original_network_settings { fi } +function wifi_original_network_settings { + remove_config_param "NETWORK_IS_STATIC" + if [ -f /etc/network/interfaces_original ]; then + cp /etc/network/interfaces_original /etc/network/interfaces + fi +} + function wifi_wpa2_psk { ssid=$1 passphrase=$2 @@ -539,9 +546,10 @@ function disable_wifi { echo '# interfaces(5) file used by ifup(8) and ifdown(8)' > /etc/network/interfaces echo '# Include files from /etc/network/interfaces.d:' >> /etc/network/interfaces echo 'source-directory /etc/network/interfaces.d' >> /etc/network/interfaces - systemctl restart network-manager + remove_config_param "WIFI_INTERFACE" wpa_action ${WIFI_INTERFACE} stop wpa_cli -i ${WIFI_INTERFACE} terminate + systemctl restart network-manager else networks_from_file fi diff --git a/src/freedombone-wifi b/src/freedombone-wifi index 80b18176..014c111d 100755 --- a/src/freedombone-wifi +++ b/src/freedombone-wifi @@ -156,7 +156,6 @@ fi if [ ${WIFI_DISABLE} ]; then disable_wifi ${WIFI_DISABLE} - remove_config_param "WIFI_INTERFACE" exit 0 fi