Skip to content
Snippets Groups Projects
Commit 7d232bc8 authored by Bob Mottram's avatar Bob Mottram
Browse files

Enabling and disabling wifi

parent 2baffb87
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -156,7 +156,6 @@ fi
if [ ${WIFI_DISABLE} ]; then
disable_wifi ${WIFI_DISABLE}
remove_config_param "WIFI_INTERFACE"
exit 0
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment