diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index c68815a9..d0c65968 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -1437,8 +1437,13 @@ function wifi_settings { cp $TEMP_WIFI_NETWORKS_FILE $WIFI_NETWORKS_FILE rm $TEMP_WIFI_NETWORKS_FILE ${PROJECT_NAME}-wifi --networks $WIFI_NETWORKS_FILE - dialog --title $"Wifi Settings" \ - --msgbox $"Wifi settings were changed" 6 40 + if [[ $(wifi_is_running) == "1" ]]; then + dialog --title $"Wifi Settings" \ + --msgbox $"Wifi settings were changed." 6 60 + else + dialog --title $"Wifi Settings" \ + --msgbox $"Wifi settings were changed. You will need to restart the system for the changes to take effect." 6 60 + fi fi } diff --git a/src/freedombone-utils-final b/src/freedombone-utils-final index 54b91516..03314d89 100755 --- a/src/freedombone-utils-final +++ b/src/freedombone-utils-final @@ -66,7 +66,9 @@ function install_final { fi if [ ! -f $IMAGE_PASSWORD_FILE ]; then if [ -f /root/${PROJECT_NAME}-wifi.cfg ]; then - ${PROJECT_NAME}-wifi + if [[ $(wifi_is_running) == "0" ]]; then + ${PROJECT_NAME}-wifi + fi fi reboot fi diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index 799d0f84..0ceba8e8 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -39,6 +39,15 @@ WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg # repo for atheros AR9271 wifi driver ATHEROS_WIFI_REPO="https://github.com/qca/open-ath9k-htc-firmware.git" +function wifi_is_running { + wifi_state=$(wpa_cli status) + if [[ "$wifi_state" == *"COMPLETED"* ]]; then + echo "1" + else + echo "0" + fi +} + function setup_wifi_atheros { if [[ $(running_as_root) == "0" ]]; then return