Wifi menu style

This commit is contained in:
Bob Mottram 2018-03-17 21:45:53 +00:00
parent df1961e553
commit 1464ea0613
1 changed files with 14 additions and 20 deletions

View File

@ -2202,31 +2202,24 @@ function menu_wifi {
fi fi
fi fi
data=$(mktemp 2>/dev/null) W=(1 $"Enable or disable Wifi"
dialog --backtitle $"Freedombone Control Panel" \ 2 $"Configure wifi networks"
--title $"Wifi Menu" \ 3 $"Manually edit wifi networks file"
--radiolist $"${status_str}\\n\\nChoose an operation:" 14 70 6 \ 4 $"Hotspot settings")
1 $"Enable or disable Wifi" off \
2 $"Configure wifi networks" off \ # shellcheck disable=SC2068
3 $"Manually edit wifi networks file" off \ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Wifi Menu" --menu $"${status_str}\\n\\nChoose an operation, or ESC for main menu:" 14 70 6 "${W[@]}" 3>&2 2>&1 1>&3)
4 $"Hotspot settings" off \
5 $"Exit" on 2> "$data" if [ ! "$selection" ]; then
sel=$? break
case $sel in fi
1) rm -f "$data"
break;; case $selection in
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
1) wifi_enable;; 1) wifi_enable;;
2) wifi_settings;; 2) wifi_settings;;
3) wifi_edit_networks;; 3) wifi_edit_networks;;
4) hotspot_settings;; 4) hotspot_settings;;
5) rm -f "$data"
break;;
esac esac
rm -f "$data"
done done
} }
@ -2299,6 +2292,7 @@ function menu_top_level {
# shellcheck disable=SC2068 # shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Administrator Control Panel" --menu $"Choose an operation, or ESC to exit:" 28 60 28 "${W[@]}" 3>&2 2>&1 1>&3) selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Administrator Control Panel" --menu $"Choose an operation, or ESC to exit:" 28 60 28 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then if [ ! "$selection" ]; then
break break
fi fi