From 4500d198d13a77b00349be5b0b45f5496a3a8973 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 23 Jul 2019 12:27:29 -0400 Subject: [PATCH] use gpg --quick-gen-key by default, then fall back to just --gen-key on older legacy systems. --- fleacollar.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fleacollar.sh b/fleacollar.sh index acc0769..0148fa3 100755 --- a/fleacollar.sh +++ b/fleacollar.sh @@ -169,7 +169,10 @@ EOF echo "set pgp_timeout=1800" >> "$muttHome/gpg.rc" if [[ $(gpg --list-secret-keys | wc -l) -eq 0 ]]; then read -p "$(gettext "No gpg key was found. Type your name and press entr to generate a PGP key.control+c if you would like to create it manually.") " continue - gpg --gen-key + # Try to use quick key generation, and fall back to the more verbose version for legacy systems. + if ! gpg --quick-gen-key "${continue:-${USER}}"; then + gpg --gen-key + fi fi PS3="$(gettext "Select the key you want to use for encryption/signing:")" select key in $(gpg --list-secret-keys | grep '.*@.*' | cut -d '<' -f2 | cut -d '>' -f1) ; do