aboutsummaryrefslogtreecommitdiffstats
path: root/tools/create-hostsfile.sh
diff options
context:
space:
mode:
authorroot <root@frank.tg14.gathering.org>2014-04-13 17:24:24 +0200
committerroot <root@frank.tg14.gathering.org>2014-04-13 17:24:24 +0200
commitb7d0dc4564ae2e1f21bd79880bb325812f92fa75 (patch)
tree0c57e11fbf764b7bd779423e05bf90831e4d8732 /tools/create-hostsfile.sh
parentaee52b1f0bb95bce16fac8e671ff3ff95905c292 (diff)
New tool that adds the needed, but not documented, entries to /etc/hosts on the bootstrap
Diffstat (limited to 'tools/create-hostsfile.sh')
-rwxr-xr-xtools/create-hostsfile.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/create-hostsfile.sh b/tools/create-hostsfile.sh
new file mode 100755
index 0000000..2aaf9cb
--- /dev/null
+++ b/tools/create-hostsfile.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -e
+
+source include/tgmanage.cfg.sh
+if [ -z ${PRIMARY} ]
+then
+ echo "Not configured!";
+ exit 1;
+fi;
+
+echo >> /etc/hosts
+echo "# Bootstrap hosts entries for ${TGNAME} ">> /etc/hosts
+echo "${PRI_V6} ${PRIMARY}" >> /etc/hosts
+echo "${PRI_V4} ${PRIMARY}" >> /etc/hosts
+echo "${SEC_V6} ${SECONDARY}" >> /etc/hosts
+echo "${SEC_V4} ${SECONDARY}" >> /etc/hosts