diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 3f5903c6..1ef6e689 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -2106,33 +2106,26 @@ function domain_blocking { function menu_users { while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Manage Users" \ - --radiolist $"Choose an operation:" 13 70 6 \ - 1 $"Add a user" off \ - 2 $"Delete a user" off \ - 3 $"Change user password" off \ - 4 $"Change user ssh public key" off \ - 5 $"Reset password tries" 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 $"Add a user" + 2 $"Delete a user" + 3 $"Change user password" + 4 $"Change user ssh public key" + 5 $"Reset password tries") + + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Manage Users" --menu $"Choose an operation, or ESC for main menu:" 13 70 6 "${W[@]}" 3>&2 2>&1 1>&3) + + if [ ! "$selection" ]; then + break + fi + + case $selection in 1) add_user;; 2) delete_user;; 3) change_password;; 4) change_ssh_public_key;; 5) reset_password_tries;; - 6) rm -f "$data" - break;; esac - rm -f "$data" done }