Edith configuration menu style

This commit is contained in:
Bob Mottram 2018-04-04 12:33:00 +01:00
parent cfa652cbff
commit 2cbcf7b143
1 changed files with 11 additions and 18 deletions

View File

@ -131,29 +131,22 @@ function edith_browse {
}
function configure_interactive_edith {
W=(1 $"Enable login"
2 $"Browse notes")
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone Control Panel" \
--title $"Edith" \
--radiolist $"Choose an operation:" 10 50 3 \
1 $"Enable login" off \
2 $"Browse notes" off \
3 $"Exit" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
break;;
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Edith" --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) edith_enable_login;;
2) edith_browse;;
3) rm -f "$data"
break;;
esac
rm -f "$data"
done
}