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