Check if wifi adaptors exist

This commit is contained in:
Bob Mottram 2016-11-02 20:42:56 +00:00
parent 584018797a
commit 93425b3577
2 changed files with 14 additions and 0 deletions

View File

@ -1720,6 +1720,12 @@ function wifi_enable {
}
function menu_wifi {
if [[ "$(wifi_exists)" == "0" ]]; then
dialog --title $"Wifi" \
--msgbox $"No wifi adaptors were detected" 6 40
return
fi
while true
do
status_str=$'Wifi OFF'

View File

@ -573,6 +573,14 @@ function count_wlan {
echo $ctr
}
function wifi_exists {
if grep -q "wlan" /proc/net/dev; then
echo "1"
else
echo "0"
fi
}
function remove_wifi_startup_script {
remove_config_param "WIFI_INTERFACE"
systemd_file=/etc/systemd/system/wifistart.service