pleroma configuration menu style

This commit is contained in:
Bob Mottram 2018-04-04 12:46:55 +01:00
parent e47bf36beb
commit 5deca1d6a1
1 changed files with 14 additions and 21 deletions

View File

@ -674,33 +674,26 @@ function configure_interactive_pleroma {
read_config_param PLEROMA_EXPIRE_MONTHS read_config_param PLEROMA_EXPIRE_MONTHS
while true while true
do do
data=$(mktemp 2>/dev/null) W=(1 $"Set a background image"
dialog --backtitle $"Freedombone Control Panel" \ 2 $"Set the title"
--title $"Pleroma" \ 3 $"Disable new account registrations"
--radiolist $"Choose an operation:" 15 70 6 \ 4 $"Add a custom emoji"
1 $"Set a background image" off \ 5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)")
2 $"Set the title" off \
3 $"Disable new account registrations" off \ # shellcheck disable=SC2068
4 $"Add a custom emoji" off \ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 14 60 5 "${W[@]}" 3>&2 2>&1 1>&3)
5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)" off \
6 $"Exit" on 2> "$data" if [ ! "$selection" ]; then
sel=$? break
case $sel in fi
1) rm -f "$data"
return;; case $selection in
255) rm -f "$data"
return;;
esac
case $(cat "$data") in
1) pleroma_set_background_image;; 1) pleroma_set_background_image;;
2) pleroma_set_title;; 2) pleroma_set_title;;
3) pleroma_disable_registrations;; 3) pleroma_disable_registrations;;
4) pleroma_add_emoji;; 4) pleroma_add_emoji;;
5) pleroma_set_expire_months;; 5) pleroma_set_expire_months;;
6) rm -f "$data"
break;;
esac esac
rm -f "$data"
done done
} }