diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-08-19 14:06:04 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-08-19 14:06:04 -0300 |
commit | a2ee9ed43deee8cd0c8370043b9b05130c8f74f5 (patch) | |
tree | 5eac4b51f61bcb6f3243cf4e9b3424e4c943edfd /share | |
parent | 2b0988af09d51b445a5acd10e0f5a01004f5cb19 (diff) | |
download | hydra-a2ee9ed43deee8cd0c8370043b9b05130c8f74f5.tar.gz hydra-a2ee9ed43deee8cd0c8370043b9b05130c8f74f5.tar.bz2 |
Updates import-keys for gnupg2 compatibility
Diffstat (limited to 'share')
-rwxr-xr-x | share/hydra/import-keys | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/share/hydra/import-keys b/share/hydra/import-keys index 9f10e94..fe026b6 100755 --- a/share/hydra/import-keys +++ b/share/hydra/import-keys @@ -23,7 +23,8 @@ hydra_config_load # Import OpenPGP keypair function hydra_import_keys_openpgp { key="$(keyringer $HYDRA decrypt nodes/$hostname/gpg/key 2> /dev/null | sed -ne '1,$p')" - key_id="$(echo "$key" | gpg --with-colons | grep sec | cut -d : -f 5)" + pubkey="$(keyringer $HYDRA decrypt nodes/$hostname/gpg/key.pub 2> /dev/null | sed -ne '1,$p')" + key_id="$(echo "$pubkey" | gpg --with-colons | grep pub | cut -d : -f 5)" if [ -z "$key" ]; then echo "Could not find key for $node, skipping." @@ -41,7 +42,7 @@ function hydra_import_keys_openpgp { echo "$key" | sudo gpg --homedir /root/.gnupg --import echo "" - echo "Trusting key at $node..." + echo "Trusting key $key_id at $node..." echo "" printf "trust\n5\ny\nsave\n" | sudo gpg --homedir /root/.gnupg --no-tty --status-fd=2 --command-fd=0 --edit-key $key_id @@ -60,7 +61,7 @@ EOF echo "$key" | sudo gpg --homedir /root/.gnupg --import echo "" - echo "Trusting key at $node..." + echo "Trusting key $key_id at $node..." echo "" printf "trust\n5\ny\nsave\n" | sudo gpg --homedir /root/.gnupg --no-tty --status-fd=2 --command-fd=0 --edit-key $key_id |