diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 3882fdf9b0d369a5bb9a2cfeadf375ea66eb2046..3f5903c61db6ae7a066c3f48d4e3ebcead5f1c9c 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -2202,31 +2202,24 @@ function menu_wifi { fi fi - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Wifi Menu" \ - --radiolist $"${status_str}\\n\\nChoose an operation:" 14 70 6 \ - 1 $"Enable or disable Wifi" off \ - 2 $"Configure wifi networks" off \ - 3 $"Manually edit wifi networks file" off \ - 4 $"Hotspot settings" off \ - 5 $"Exit" on 2> "$data" - sel=$? - case $sel in - 1) rm -f "$data" - break;; - 255) rm -f "$data" - break;; - esac - case $(cat "$data") in + W=(1 $"Enable or disable Wifi" + 2 $"Configure wifi networks" + 3 $"Manually edit wifi networks file" + 4 $"Hotspot settings") + + # shellcheck disable=SC2068 + 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) + + if [ ! "$selection" ]; then + break + fi + + case $selection in 1) wifi_enable;; 2) wifi_settings;; 3) wifi_edit_networks;; 4) hotspot_settings;; - 5) rm -f "$data" - break;; esac - rm -f "$data" done } @@ -2299,6 +2292,7 @@ function menu_top_level { # 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) + if [ ! "$selection" ]; then break fi