copy.sh 1.27 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 wgrouter"
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
  scp $STA/db.020 root@$H:/etc/bind/zones/
hark's avatar
hark committed
47 48 49 50 51 52
  scp $STA/net.020wireless.nl.db root@$H:/etc/bind/zones/
  scp $STA/squesh.net.db root@$H:/etc/bind/zones/
  scp $STA/squesh.dn42.db root@$H:/etc/bind/zones/



hark's avatar
netzone  
hark committed
53

hark's avatar
hark committed
54
done
hark's avatar
netzone  
hark committed
55

hark's avatar
hark committed
56 57 58
#
# reload configs
#
hark's avatar
hark committed
59 60
#echo "reload trashbat: "
#ssh root@trashbat /etc/init.d/bind9 reload
hark's avatar
hark committed
61 62
echo "reload stanleyH: "
ssh root@stanleyH /etc/init.d/named reload
hark's avatar
hark committed
63 64 65

#echo "reload air traffic control: "
#ssh root@atc /etc/init.d/bind9 reload
hark's avatar
hem  
hark committed
66 67 68 69
echo "reload kalium"
ssh root@kalium /etc/init.d/bind9 reload
ssh root@kalium host test.020

hark's avatar
hark committed
70 71
ssh root@wgrouter /etc/init.d/bind9 reload