copy.sh 1.07 KB
Newer Older
hark's avatar
hark committed
1 2 3 4
#!/bin/bash -x

. paths.sh

hark's avatar
hark committed
5
HOSTS="stanleyH kalium"
hark's avatar
hark committed
6 7 8 9 10 11 12 13 14 15 16 17

cz ()
{
# copies the zonefiles
#  $1 name
#  $2 reverse
  echo "copying $1 zone, with subnet $2"
  cd $OUT/$1.020
  scp db.$1 db.$2  root@$H:/etc/bind/zones/
  cd $OUT
}

hark's avatar
hark committed
18

hark's avatar
hark committed
19 20
for H in $HOSTS
do
hark's avatar
hark committed
21

hark's avatar
hem  
hark committed
22 23
  ssh $H "mkdir /etc/bind/zones/"

hark's avatar
hark committed
24 25 26 27 28 29 30
  #gitzones
  scp $HFD/gitzones.conf root@$H:/etc/bind/zones/
  #forward
  scp $HFD/forwardzones.conf root@$H:/etc/bind/zones/
  #adm
  scp $HFD/adm.conf root@$H:/etc/bind/zones/
  #
hark's avatar
hark committed
31
  # autogenerated zones
hark's avatar
hark committed
32
  #
hark's avatar
hark committed
33 34 35 36 37
  cz amsw 10.205.252
  cz routers 10.205.253
  cz transfernet 10.205.255
  cz ki 10.205.14
  cz irl 10.205.12
yids's avatar
yids committed
38

hark's avatar
hark committed
39 40 41
  #
  # Copy static zones 
  #
yids's avatar
yids committed
42

hark's avatar
hark committed
43 44
  # Static zones
  scp $HFD/staticzones.conf root@$H:/etc/bind/zones/
hark's avatar
netzone  
hark committed
45

hark's avatar
hark committed
46 47
  #020.
  scp $STA/db.020 root@$H:/etc/bind/zones/
hark's avatar
netzone  
hark committed
48

hark's avatar
hark committed
49
done
hark's avatar
netzone  
hark committed
50

hark's avatar
hark committed
51 52 53
#
# reload configs
#
hark's avatar
hark committed
54 55
#echo "reload trashbat: "
#ssh root@trashbat /etc/init.d/bind9 reload
hark's avatar
hark committed
56 57
echo "reload stanleyH: "
ssh root@stanleyH /etc/init.d/named reload
hark's avatar
hark committed
58 59 60

#echo "reload air traffic control: "
#ssh root@atc /etc/init.d/bind9 reload
hark's avatar
hem  
hark committed
61 62 63 64
echo "reload kalium"
ssh root@kalium /etc/init.d/bind9 reload
ssh root@kalium host test.020