summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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..."