diff --git a/src/freedombone-app-gnusocial b/src/freedombone-app-gnusocial index 068c1c28..0428a46c 100755 --- a/src/freedombone-app-gnusocial +++ b/src/freedombone-app-gnusocial @@ -303,37 +303,31 @@ function gnusocial_set_expire_months { } function configure_interactive_gnusocial { + W=(1 $"Set a background image" + 2 $"Set the title" + 3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)" + 4 $"Select Qvitter user interface" + 5 $"Select Pleroma user interface" + 6 $"Select Classic user interface") + read_config_param GNUSOCIAL_EXPIRE_MONTHS while true do - data=$(mktemp 2>/dev/null) - dialog --backtitle $"Freedombone Control Panel" \ - --title $"GNU Social" \ - --radiolist $"Choose an operation:" 16 70 7 \ - 1 $"Set a background image" off \ - 2 $"Set the title" off \ - 3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)" off \ - 4 $"Select Qvitter user interface" off \ - 5 $"Select Pleroma user interface" off \ - 6 $"Select Classic user interface" off \ - 7 $"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 $"GNU Social" --menu $"Choose an operation, or ESC to exit:" 15 60 6 "${W[@]}" 3>&2 2>&1 1>&3) + + if [ ! "$selection" ]; then + break + fi + + case $selection in 1) gnusocial_set_background_image;; 2) gnusocial_set_title;; 3) gnusocial_set_expire_months;; 4) gnusocial_use_qvitter gnusocial;; 5) gnusocial_use_pleroma gnusocial;; 6) gnusocial_use_classic gnusocial;; - 7) break;; esac - rm -f "$data" done }