diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-11-23 22:13:10 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-11-23 22:13:10 -0200 |
commit | df77e4204fd85e144be0d085ec210aa3fb584191 (patch) | |
tree | 6a0e347564abcac9f573681e3cffdf78ad7c31e1 | |
parent | 8a575220f58c268486969ad464fc51ca25aa3713 (diff) | |
download | hydra-df77e4204fd85e144be0d085ec210aa3fb584191.tar.gz hydra-df77e4204fd85e144be0d085ec210aa3fb584191.tar.bz2 |
Decrypting just once at import-key
-rwxr-xr-x | share/hydra/import-key | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/share/hydra/import-key b/share/hydra/import-key index c1b141c..3cddaef 100755 --- a/share/hydra/import-key +++ b/share/hydra/import-key @@ -23,9 +23,10 @@ fi # Deploy for node in $NODES; do hostname="`echo $node | cut -d . -f 1`" - key_id="`keyringer $HYDRA decrypt $hostname/gpg/key 2> /dev/null | gpg --with-colons | grep sec | cut -d : -f 5`" + key="$(keyringer $HYDRA decrypt $hostname/gpg/key 2> /dev/null | sed -ne '1,$p')" + key_id="$(echo "$key" | gpg --with-colons | grep sec | cut -d : -f 5)" - if [ -z "$key_id" ]; then + if [ -z "$key" ]; then echo "Could not find key for $node, skipping." continue fi @@ -35,7 +36,7 @@ for node in $NODES; do echo "Importing gpg key to $node..." echo "-----------------------------" echo "" - keyringer $HYDRA decrypt $hostname/gpg/key | $HYDRA_CONNECT $node sudo gpg --homedir /root/.gnupg --import + echo "$key" | $HYDRA_CONNECT $node sudo gpg --homedir /root/.gnupg --import echo "" echo "Trusting key at $node..." |