diff options
author | root <root@frank.tg14.gathering.org> | 2014-04-13 17:24:24 +0200 |
---|---|---|
committer | root <root@frank.tg14.gathering.org> | 2014-04-13 17:24:24 +0200 |
commit | b7d0dc4564ae2e1f21bd79880bb325812f92fa75 (patch) | |
tree | 0c57e11fbf764b7bd779423e05bf90831e4d8732 /tools | |
parent | aee52b1f0bb95bce16fac8e671ff3ff95905c292 (diff) |
New tool that adds the needed, but not documented, entries to /etc/hosts on the bootstrap
Diffstat (limited to 'tools')
-rw-r--r-- | tools/README | 2 | ||||
-rwxr-xr-x | tools/create-hostsfile.sh | 17 | ||||
-rwxr-xr-x | tools/create-shellconf.pl | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/tools/README b/tools/README index 2276ebb..04828cb 100644 --- a/tools/README +++ b/tools/README @@ -42,6 +42,8 @@ Edit 'include/config.local.pm' and update for this year's TG. Use 'tools/create-shellconf.pl' to extract configuration from the perl module to create/update the 'include/tgmanage.cfg.sh' configuration script. +Run 'tools/create-hostsfile.sh' to make sure the bootstrap-box can use +hostnames to reach the pri/sec DNS even before DNS is set up. The tools make extensive use of key-based SSH logins, to make this work seamlessly, run 'tools/init-sshkeys.sh' to create an RSA priv/pub keypair, and 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 diff --git a/tools/create-shellconf.pl b/tools/create-shellconf.pl index d7abdab..be7fb93 100755 --- a/tools/create-shellconf.pl +++ b/tools/create-shellconf.pl @@ -42,7 +42,9 @@ print CFG "PRIMARY=\"$pri_hostname.$tgname.gathering.org\"\n"; print CFG "SECONDARY=\"$sec_hostname.$tgname.gathering.org\"\n"; print CFG "TGNAME=\"$tgname\"\n\n"; print CFG "PRI_V4=\"$pri_v4\"\n"; +print CFG "PRI_V6=\"$pri_v6\"\n"; print CFG "SEC_V4=\"$sec_v4\"\n\n"; +print CFG "SEC_V6=\"$sec_v6\"\n\n"; print CFG "DDNS_KEY=\"$ddns_key\"\n\n"; print CFG "BASEV4=\"$base_ipv4net\"\n"; print CFG "PREFIXV4=\"$base_ipv4prefix\"\n"; |