summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-05-12 17:39:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-05-12 17:39:52 -0300
commit89ccdde9968d89d77af5a6f0e190043cda0c717d (patch)
tree8702834b0e9cbabe84cbb9347d3ef136b19f5058 /lib
parentc5f2ce4efd3bec686576cacfe63bd1872b6c9308 (diff)
downloadhydra-89ccdde9968d89d77af5a6f0e190043cda0c717d.tar.gz
hydra-89ccdde9968d89d77af5a6f0e190043cda0c717d.tar.bz2
Adds hydra_get_fqdn_from_nodename
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index 9ffc72a..09fb3d7 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -143,3 +143,17 @@ function hydra_next_debian_release {
exit 1
fi
}
+
+# Get fqdn from nodename
+function hydra_get_fqdn_from_nodename {
+ if [ -z "$1" ]; then
+ return
+ fi
+
+ if echo $1 | grep -q '\.'; then
+ echo $1
+ else
+ domain=`hydra $HYDRA config domain`
+ echo $1.$domain
+ fi
+}