From 7f027206e6b8f6efa05d804a936037eb0d0d82e1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 4 Apr 2018 13:08:03 +0100 Subject: [PATCH] etherpad configuration menu style --- src/freedombone-app-etherpad | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/freedombone-app-etherpad b/src/freedombone-app-etherpad index 3502e507..31f8298e 100755 --- a/src/freedombone-app-etherpad +++ b/src/freedombone-app-etherpad @@ -269,29 +269,22 @@ function etherpad_set_welcome_message { } function configure_interactive_etherpad { + W=(1 $"Set Title" + 2 $"Set a welcome message") + while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Etherpad Settings" \ - --radiolist $"Choose an operation:" 12 70 3 \ - 1 $"Set Title" off \ - 2 $"Set a welcome message" off \ - 3 $"Exit" on 2> "$data" - sel=$? - case $sel in - 1) rm -f "$data" - return;; - 255) rm -f "$data" - return;; - esac - case $(cat "$data") in + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Etherpad" --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) etherpad_set_title;; 2) etherpad_set_welcome_message;; - 3) rm -f "$data" - break;; esac - rm -f "$data" done }