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 }