From 6c97c1601e33236c39e5c61774b938f3a9b3bbcc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 17 Mar 2018 21:49:38 +0000 Subject: [PATCH] Blocking menu style --- src/freedombone-controlpanel | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 1ef6e689..07943e1f 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -2073,33 +2073,22 @@ function domain_blocking_show { function domain_blocking { while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Domain or User Blocking" \ - --radiolist $"Choose an operation:" 14 60 6 \ - 1 $"Block a domain or user" off \ - 2 $"Unblock a domain or user" off \ - 3 $"Block an IP address" off \ - 4 $"Unblock an IP address" off \ - 5 $"Show blocked domains and users" off \ - 6 $"Back to main menu" on 2> "$data" - sel=$? - case $sel in - 1) rm -f "$data" - break;; - 255) rm -f "$data" - break;; - esac - case $(cat "$data") in + W=(1 $"Block a domain or user" + 2 $"Unblock a domain or user" + 3 $"Block an IP address" + 4 $"Unblock an IP address" + 5 $"Show blocked domains and users") + + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Domain or User Blocking" --menu $"Choose an operation, or ESC for main menu:" 13 70 6 "${W[@]}" 3>&2 2>&1 1>&3) + + case $selection in 1) domain_blocking_add;; 2) domain_blocking_remove;; 3) ip_blocking_add;; 4) ip_blocking_remove;; 5) domain_blocking_show;; - 6) rm -f "$data" - break;; esac - rm -f "$data" done }