Encryption keys menu style

This commit is contained in:
Bob Mottram 2018-03-17 21:35:48 +00:00
parent 498561ac49
commit 4a3eb2cdb0
1 changed files with 19 additions and 26 deletions

View File

@ -732,29 +732,25 @@ function gpg_key_trust {
function menu_encryption_keys {
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone User Control Panel" \
--title $"My Encryption Keys" \
--radiolist $"Choose an operation:" 19 70 11 \
1 $"Show your PGP/GPG key" off \
2 $"Show your full PGP/GPG key, including private key" off \
3 $"Publish your PGP/GPG key so that others can find it" off \
4 $"Add someone's PGP/GPG key" off \
5 $"Remove someone's PGP/GPG key" off \
6 $"Sign a PGP/GPG key or website domain" off \
7 $"Refresh your PGP/GPG keys" off \
8 $"Add an ssh key for logging in" off \
9 $"Remove an ssh key for logging in" off \
10 $"Set the trust level for a PGP/GPG key" off \
11 $"Back to main menu" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
break;;
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
W=(1 $"Show your PGP/GPG key"
2 $"Show your full PGP/GPG key, including private key"
3 $"Publish your PGP/GPG key so that others can find it"
4 $"Add someone's PGP/GPG key"
5 $"Remove someone's PGP/GPG key"
6 $"Sign a PGP/GPG key or website domain"
7 $"Refresh your PGP/GPG keys"
8 $"Add an ssh key for logging in"
9 $"Remove an ssh key for logging in"
10 $"Set the trust level for a PGP/GPG key")
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone User Control Panel" --title $"My Encryption Keys" --menu $"Choose an operation, or ESC for main menu:" 14 70 7 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
fi
case $selection in
1) show_gpg_key;;
2) show_full_gpg_key;;
3) publish_gpg_key;;
@ -765,10 +761,7 @@ function menu_encryption_keys {
8) add_ssh_key;;
9) remove_ssh_key;;
10) gpg_key_trust;;
11) rm -f "$data"
break;;
esac
rm -f "$data"
done
}