summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/newkeys16
1 files changed, 8 insertions, 8 deletions
diff --git a/share/hydra/newkeys b/share/hydra/newkeys
index 3fe782f..baffe28 100755
--- a/share/hydra/newkeys
+++ b/share/hydra/newkeys
@@ -25,17 +25,17 @@ function hydra_newkeys {
NODES="`hydra $HYDRA nodes`"
fi
- for host in $NODES; do
- node="`echo $host | cut -d . -f 1`"
- sshkey="$HYDRA_FOLDER/keyring/keys/nodes/$node/ssh/id_rsa.asc"
- gpgkey="$HYDRA_FOLDER/keyring/keys/nodes/$node/gpg/key.asc"
+ for node in $NODES; do
+ node="`hydra_get_fqdn_from_nodename $node`"
+ sshkey="$HYDRA_FOLDER/keyring/keys/nodes/$fqdn/ssh/id_rsa.asc"
+ gpgkey="$HYDRA_FOLDER/keyring/keys/nodes/$fqdn/gpg/key.asc"
if [ "$1" == "all" ]; then
hydra_genpairs
elif [ "$1" == "all-ssh" ]; then
hydra_genpairs ssh
elif [ "$1" == "all-pgp" ]; then
hydra_genpairs pgp
- elif [ ! -z "$1" ] && [ "$node" == "$1" ]; then
+ elif [ ! -z "$1" ] && [ "$fqdn" == "$1" ]; then
hydra_genpairs $2
exit $?
elif [ ! -e "$sshkey" ] || [ ! -e "$gpgkey" ]; then
@@ -48,15 +48,15 @@ function hydra_genpairs {
BASEDIR="/tmp"
if [ "$1" != "pgp" ]; then
- keyringer $HYDRA genpair ssh nodes/$node/ssh/id_rsa $host
+ keyringer $HYDRA genpair ssh nodes/$fqdn/ssh/id_rsa $fqdn
fi
if [ "$1" != "ssh" ]; then
- keyringer $HYDRA genpair gpg nodes/$node/gpg/key $host
+ keyringer $HYDRA genpair gpg nodes/$fqdn/gpg/key $fqdn
fi
hydra_set_tmpfile genpair
- echo "Importing keys for $host" > $TMPWORK
+ echo "Importing keys for $fqdn" > $TMPWORK
keyringer $HYDRA git commit -F $TMPWORK
keyringer $HYDRA git push