From 54ec3b2dda099a52bf1626cc53810949028ede91 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 4 Apr 2018 12:40:11 +0100 Subject: [PATCH] Friendica configuration menu style --- src/freedombone-app-friendica | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/freedombone-app-friendica b/src/freedombone-app-friendica index 0d3447bb..91adc6d5 100755 --- a/src/freedombone-app-friendica +++ b/src/freedombone-app-friendica @@ -152,31 +152,26 @@ function friendica_allow_registrations { } function configure_interactive_friendica { + W=(1 $"Set channel directory server" + 2 $"Renew SSL certificate" + 3 $"Close new account registrations" + 4 $"Allow new account registrations") + while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"Friendica" \ - --radiolist $"Choose an operation:" 15 70 6 \ - 1 $"Set channel directory server" off \ - 2 $"Renew SSL certificate" off \ - 3 $"Close new account registrations" off \ - 4 $"Allow new account registrations" off \ - 5 $"Back to main menu" on 2> "$data" - sel=$? - case $sel in - 1) break;; - 255) break;; - esac - case $(cat "$data") in + # shellcheck disable=SC2068 + selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Friendica" --menu $"Choose an operation, or ESC to exit:" 14 60 4 "${W[@]}" 3>&2 2>&1 1>&3) + + if [ ! "$selection" ]; then + break + fi + + case $selection in 1) friendica_channel_directory_server;; 2) friendica_renew_cert;; 3) friendica_close_registrations;; 4) friendica_allow_registrations;; - 5) rm -f "$data" - break;; esac - rm -f "$data" done }