improve gpg key listing command

This commit is contained in:
Jaromil 2019-05-18 09:50:57 +02:00
parent ec31d2d280
commit 91e607efb5

4
tomb
View File

@ -955,7 +955,7 @@ is_valid_recipients() {
# All the keys ID must be valid (the public keys must be present in the database) # All the keys ID must be valid (the public keys must be present in the database)
for gpg_id in ${recipients[@]}; do for gpg_id in ${recipients[@]}; do
gpg --list-keys "$gpg_id" &> /dev/null gpg --with-colons --batch --list-keys "$gpg_id" &> /dev/null
[[ $? != 0 ]] && { [[ $? != 0 ]] && {
_warning "Not a valid GPG key ID: ::1 gpgid:: " $gpg_id _warning "Not a valid GPG key ID: ::1 gpgid:: " $gpg_id
return 1 return 1
@ -964,7 +964,7 @@ is_valid_recipients() {
# At least one private key must be present # At least one private key must be present
for gpg_id in ${recipients[@]}; do for gpg_id in ${recipients[@]}; do
gpg --list-secret-keys "$gpg_id" &> /dev/null gpg --with-colons --batch --list-secret-keys "$gpg_id" &> /dev/null
[[ $? = 0 ]] && { [[ $? = 0 ]] && {
return 0 return 0
} }