When using blackbox_addadmin, if the key addition fails, key name still shows in blackbox-admins.txt
I ran blackbox_addadmin key.asc thinking I could do that to insert a public key. This failed, but, it still put key.asc in the blackbox-admins.txt file. This causes all further operations to fail because there is no key in the keyring with the name key.asc.
Do you have a suggestion of how to check to see if a string is a GPG key name (in bash)?
Instead of seeing if it's a GPG key via GPG, maybe see if its a public key that was passed?
[ -f $FILE ] && head -n 1 $FILE | grep -q 'PUBLIC KEY' && echo "is public key"
The easiest way to fix this would just be to add the key to blackbox-admins.txt AFTER adding it to the keyring via gpg.