summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-23 22:13:10 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-23 22:13:10 -0200
commitdf77e4204fd85e144be0d085ec210aa3fb584191 (patch)
tree6a0e347564abcac9f573681e3cffdf78ad7c31e1 /share
parent8a575220f58c268486969ad464fc51ca25aa3713 (diff)
downloadhydra-df77e4204fd85e144be0d085ec210aa3fb584191.tar.gz
hydra-df77e4204fd85e144be0d085ec210aa3fb584191.tar.bz2
Decrypting just once at import-key
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/import-key7
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..."