aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-05-12 17:41:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-05-12 17:41:00 -0300
commit06ceac94adf72e37d42d455503c4a4778ce28609 (patch)
tree913c1f00b9b46ab5eae08dea4c9c4a0f71f759d4 /share
parentfaba99e4402e8a584b3ff098d06afb3bcc1667f0 (diff)
downloadhydra-06ceac94adf72e37d42d455503c4a4778ce28609.tar.gz
hydra-06ceac94adf72e37d42d455503c4a4778ce28609.tar.bz2
Use hydra_get_fqdn_from_nodename on newkeys
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