sops-init-gpg-key: print fingerprint

This commit is contained in:
Jörg Thalheim 2020-07-13 07:25:08 +01:00
parent d8e505804a
commit bdfd4c3389
No known key found for this signature in database
GPG key ID: 003F2096411B5F92

View file

@ -66,10 +66,13 @@ Expire-Date: 0
EOF
gpg --quiet --batch --gen-key "${GNUPGHOME}/key-template"
echo "You can use the following command to save it to a file:"
echo "cat > $HOSTNAME.asc <<EOF"
gpg --export --armor
echo 'EOF'
echo >&2 "You can use the following command to save it to a file:"
echo >&2 "cat > $HOSTNAME.asc <<EOF"
gpg --export --armor >&2
echo >&2 'EOF'
fpr=$(gpg --quiet --list-keys --with-colons --fingerprint | awk -F: '$1 == "fpr" { print $10;}')
echo >&2 "fingerprint: $fpr"
rm "${GNUPGHOME}/key-template"
parent=$(dirname "$FINAL_GNUPGHOME")