aboutsummaryrefslogtreecommitdiffstats
path: root/tools/update-baseservice.sh
blob: 5908941cb2a2c686e18f547cf11a892637de5846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

set -e

BASE="";
if [ -n $1 ]
then
	BASE=$1
	echo "Using base path ${BASE}"
fi

source include/tgmanage.cfg.sh
if [ -z ${PRIMARY} ]
then
	echo "Not configured!";
	exit 1;
fi;

cat netlist.txt | ssh -l root ${PRIMARY} "~/tgmanage/tools/make-missing-conf.pl master ${BASE}"
ssh -l root ${PRIMARY} "~/tgmanage/tools/make-dhcpd-include.pl ${BASE}"
ssh -l root ${PRIMARY} "~/tgmanage/tools/make-bind-include.pl master ${BASE}"

set +e
ssh -l root ${PRIMARY} "chown bind.bind /etc/bind/dynamic/*.zone";
set -e

cat netlist.txt | ssh -l root ${SECONDARY} "~/tgmanage/tools/make-missing-conf.pl slave ${BASE}"
ssh -l root ${SECONDARY} "~/tgmanage/tools/make-bind-include.pl slave ${BASE}"