From 85b7fbdecdfb92a155720dbe003a32e030964429 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 4 Apr 2018 13:13:09 +0100 Subject: [PATCH] scuttlebot configuration menu style --- src/freedombone-app-scuttlebot | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/freedombone-app-scuttlebot b/src/freedombone-app-scuttlebot index 7d8418fe..261e68d5 100755 --- a/src/freedombone-app-scuttlebot +++ b/src/freedombone-app-scuttlebot @@ -67,27 +67,20 @@ function scuttlebot_create_invite { } function configure_interactive_scuttlebot { + W=(1 $"Create an invite") + while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Scuttlebot" \ - --radiolist $"Choose an operation:" 10 50 2 \ - 1 $"Create an invite" off \ - 2 $"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 $"Scuttlebot" --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) scuttlebot_create_invite;; - 2) rm -f "$data" - break;; esac - rm -f "$data" done }