From e96027b8d300f07f38782f6b70cadf9da1ae0e81 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 17 Mar 2018 21:19:41 +0000 Subject: [PATCH] Different menu style --- src/freedombone-controlpanel | 67 ++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index f4cf7504..49080a85 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -2275,41 +2275,37 @@ function menu_app_settings { function menu_top_level { while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Control Panel" \ - --radiolist $"Choose an operation:" 30 70 22 \ - 1 $"About this system" off \ - 2 $"Passwords" off \ - 3 $"Backup and Restore" off \ - 4 $"Show Firewall" off \ - 5 $"Verify Tripwire Code" off \ - 6 $"Reset Tripwire" off \ - 7 $"App Settings" off \ - 8 $"Add/Remove Apps" off \ - 9 $"Logging on/off" off \ - 10 $"Ping enable/disable" off \ - 11 $"Manage Users" off \ - 12 $"Email Menu" off \ - 13 $"Domain or User Blocking" off \ - 14 $"Security Settings" off \ - 15 $"Change the name of this system" off \ - 16 $"Set a static local IP address" off \ - 17 $"Wifi menu" off \ - 18 $"Add Clacks" off \ - 19 $"Check for updates" off \ - 20 $"Power off the system" off \ - 21 $"Restart the system" off \ - 22 $"Exit" on 2> "$data" - sel=$? - case $sel in - 1) rm -f "$data" - exit 1;; - 255) rm -f "$data" - exit 1;; - esac + W=(1 $"About this system" + 2 $"Passwords" + 3 $"Backup and Restore" + 4 $"Show Firewall" + 5 $"Verify Tripwire Code" + 6 $"Reset Tripwire" + 7 $"App Settings" + 8 $"Add/Remove Apps" + 9 $"Logging on/off" + 10 $"Ping enable/disable" + 11 $"Manage Users" + 12 $"Email Menu" + 13 $"Domain or User Blocking" + 14 $"Security Settings" + 15 $"Change the name of this system" + 16 $"Set a static local IP address" + 17 $"Wifi menu" + 18 $"Add Clacks" + 19 $"Check for updates" + 20 $"Power off the system" + 21 $"Restart the system") + + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Control Panel" --title $"Control Panel" --menu $"Choose an operation, or ESC to exit:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3) + if [ ! "$selection" ]; then + break + fi + please_wait - case $(cat "$data") in + + case $selection in 1) show_about;; 2) view_or_change_passwords;; 3) menu_backup_restore;; @@ -2335,10 +2331,7 @@ function menu_top_level { 19) check_for_updates;; 20) shut_down_system;; 21) restart_system;; - 22) rm -f "$data" - break;; esac - rm -f "$data" done }