diff --git a/src/freedombone-app-irc b/src/freedombone-app-irc index 5212f17d..45fb06ef 100755 --- a/src/freedombone-app-irc +++ b/src/freedombone-app-irc @@ -398,28 +398,22 @@ function configure_interactive_irc { return fi + W=(1 $"Set a password for all IRC users" + 2 $"Show current IRC login password") + while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"IRC Menu" \ - --radiolist $"Choose an operation:" 14 70 4 \ - 1 $"Set a password for all IRC users" off \ - 2 $"Show current IRC login password" off \ - 3 $"Exit" on 2> "$data" - sel=$? - case $sel in - 1) rm -f "$data" - break;; - 255) rm -f "$data" - break;; - esac - case $(cat "$data") in + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"IRC" --menu $"Choose an operation, or ESC to exit:" 10 60 2 "${W[@]}" 3>&2 2>&1 1>&3) + + if [ ! "$selection" ]; then + break + fi + + case $selection in 1) irc_set_global_password;; 2) irc_show_password;; - 3) break;; esac - rm -f "$data" done }