aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-08 19:44:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-08 19:44:24 -0300
commit61969d022aeeaa39822758ba5eadf5a37ef4ec20 (patch)
tree30dc35615ed51fb36d6a59b82b0d79e44d233a57 /share
parent7b60ac4e7dfecf54953df6d588c5af0864e56ee7 (diff)
downloadhydra-61969d022aeeaa39822758ba5eadf5a37ef4ec20.tar.gz
hydra-61969d022aeeaa39822758ba5eadf5a37ef4ec20.tar.bz2
Optional argument to import a non-default key (useful for backup restoration) at import-key
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/import-key7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/hydra/import-key b/share/hydra/import-key
index 5658728..ffffb06 100755
--- a/share/hydra/import-key
+++ b/share/hydra/import-key
@@ -35,7 +35,12 @@ fi
# Deploy
for node in $NODES; do
- hostname="`echo $node | cut -d . -f 1`"
+ if [ ! -z "$HOST" ]; then
+ hostname="$HOST"
+ else
+ hostname="`echo $node | cut -d . -f 1`"
+ fi
+
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)"