Browse Source

Check if wifi adaptors exist

Bob Mottram 8 years ago
parent
commit
93425b3577
2 changed files with 14 additions and 0 deletions
  1. 6
    0
      src/freedombone-controlpanel
  2. 8
    0
      src/freedombone-utils-wifi

+ 6
- 0
src/freedombone-controlpanel View File

@@ -1720,6 +1720,12 @@ function wifi_enable {
1720 1720
 }
1721 1721
 
1722 1722
 function menu_wifi {
1723
+    if [[ "$(wifi_exists)" == "0" ]]; then
1724
+        dialog --title $"Wifi" \
1725
+               --msgbox $"No wifi adaptors were detected" 6 40
1726
+        return
1727
+    fi
1728
+
1723 1729
     while true
1724 1730
     do
1725 1731
         status_str=$'Wifi OFF'

+ 8
- 0
src/freedombone-utils-wifi View File

@@ -573,6 +573,14 @@ function count_wlan {
573 573
     echo $ctr
574 574
 }
575 575
 
576
+function wifi_exists {
577
+    if grep -q "wlan" /proc/net/dev; then
578
+        echo "1"
579
+    else
580
+        echo "0"
581
+    fi
582
+}
583
+
576 584
 function remove_wifi_startup_script {
577 585
     remove_config_param "WIFI_INTERFACE"
578 586
     systemd_file=/etc/systemd/system/wifistart.service