aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md1
-rwxr-xr-xshare/hydra/import-key7
2 files changed, 6 insertions, 2 deletions
diff --git a/TODO.md b/TODO.md
index 409f524..0f16ed9 100644
--- a/TODO.md
+++ b/TODO.md
@@ -6,7 +6,6 @@ Hydra
- bootless: properly support `$subdevice` in parted or always use first device (like `/dev/sdb1`).
- puppet-setup-stored: configure storeconfigs database.
- - import-key: optional argument to import a non-default key (useful for backup restoration).
Hydractl
--------
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)"