From 8d5d3ba292050c5166d0c9ca2fa2198400ef7dfe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 21 Oct 2016 18:16:00 +0100 Subject: [PATCH] wifi interface up after networks --- src/freedombone-utils-wifi | 3 +++ src/freedombone-wifi | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index ad4880b4..10ab3600 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -70,6 +70,7 @@ function setup_wifi_atheros { cd $curr_dir update_wifi_adaptors if [ $IFACE ]; then + wpa_action ${IFACE} stop wpa_cli -i ${IFACE} terminate ifconfig $IFACE up fi @@ -207,6 +208,7 @@ function hotspot_off { echo 'source-directory /etc/network/interfaces.d' >> /etc/network/interfaces fi + wpa_action ${WIFI_INTERFACE} stop wpa_cli -i ${WIFI_INTERFACE} terminate systemctl restart network-manager } @@ -494,6 +496,7 @@ function disable_wifi { 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 + wpa_action ${WIFI_INTERFACE} stop wpa_cli -i ${WIFI_INTERFACE} terminate else networks_from_file diff --git a/src/freedombone-wifi b/src/freedombone-wifi index e7d57876..d069cf32 100755 --- a/src/freedombone-wifi +++ b/src/freedombone-wifi @@ -133,6 +133,7 @@ if [ ${NETWORKS_INTERACTIVE} ]; then fi if [ ! ${wifi_interface_specified} ]; then + wpa_action ${WIFI_INTERFACE} stop wpa_cli -i ${WIFI_INTERFACE} terminate update_wifi_adaptors if [ ! $IFACE ]; then @@ -142,7 +143,6 @@ if [ ! ${wifi_interface_specified} ]; then WIFI_INTERFACE=${IFACE} echo "Adaptor: $WIFI_INTERFACE" write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE" - ifconfig ${WIFI_INTERFACE} up fi if [ ${WIFI_DISABLE} ]; then @@ -153,6 +153,8 @@ fi if [ -f ${WIFI_NETWORKS_FILE} ]; then networks_from_file + ifconfig ${WIFI_INTERFACE} up + wpa_cli status exit 0 fi