Bläddra i källkod

Check if wifi adaptors exist

Bob Mottram 8 år sedan
förälder
incheckning
93425b3577
2 ändrade filer med 14 tillägg och 0 borttagningar
  1. 6
    0
      src/freedombone-controlpanel
  2. 8
    0
      src/freedombone-utils-wifi

+ 6
- 0
src/freedombone-controlpanel Visa fil

1720
 }
1720
 }
1721
 
1721
 
1722
 function menu_wifi {
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
     while true
1729
     while true
1724
     do
1730
     do
1725
         status_str=$'Wifi OFF'
1731
         status_str=$'Wifi OFF'

+ 8
- 0
src/freedombone-utils-wifi Visa fil

573
     echo $ctr
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
 function remove_wifi_startup_script {
584
 function remove_wifi_startup_script {
577
     remove_config_param "WIFI_INTERFACE"
585
     remove_config_param "WIFI_INTERFACE"
578
     systemd_file=/etc/systemd/system/wifistart.service
586
     systemd_file=/etc/systemd/system/wifistart.service