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

. paths.sh

hark's avatar
hark committed
5 6
#HOSTS="stanleyH atc kalium"
HOSTS="stanleyH kalium"
hark's avatar
hark committed
7 8 9
#
# copy all 020 reverse zones
# 
hark's avatar
hark committed
10 11 12 13
#make_zone hostfile.amsw amsw.020 10.205.252:255.255.255.0
#make_zone hostfile.routers routers.020 10.205.253:255.255.255.0
#make_zone hostfile.transfernet transfernet.020 10.205.254:255.255.255.0
#make_zone hostfile.radio radio.020 10.205.255:255.255.255.0
hark's avatar
hark committed
14

hark's avatar
hark committed
15 16
for H in $HOSTS
do
hark's avatar
hark committed
17

hark's avatar
hem  
hark committed
18 19
  ssh $H "mkdir /etc/bind/zones/"

hark's avatar
hark committed
20 21
  #gitzones
  scp $HFD/gitzones.conf root@$H:/etc/bind/zones/
hark's avatar
hark committed
22

hark's avatar
hark committed
23 24
  #forward
  scp $HFD/forwardzones.conf root@$H:/etc/bind/zones/
hark's avatar
hark committed
25

hark's avatar
hark committed
26 27
  #adm
  scp $HFD/adm.conf root@$H:/etc/bind/zones/
hark's avatar
hark committed
28

hark's avatar
hark committed
29 30 31
  #tinc tunnel
  cd $OUT/amsw.020
  scp db.10.205.252 db.amsw  root@$H:/etc/bind/zones/
hark's avatar
hark committed
32

hark's avatar
hark committed
33
  cd $OUT
hark's avatar
hark committed
34

hark's avatar
hark committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
  #routers
  cd $OUT/routers.020
  scp db.10.205.253 db.routers  root@$H:/etc/bind/zones/
  cd $OUT
  #transfernet
  cd $OUT/transfernet.020
  scp db.10.205.255 db.transfernet  root@$H:/etc/bind/zones/
  cd $OUT
  #radio
  #cd $OUT/radio.020
  #scp db.10.205.255 db.radio  root@atc:/etc/bind/zones/
  #scp db.10.205.255 db.radio  root@stanleyH:/etc/bind/zones/
  #cd $OUT
  # ki zone
  echo "copying ki zone: "

  cd $OUT/ki.020
  scp db.10.205.14 db.ki root@$H:/etc/bind/zones/
  cd $OUT


  #
  # irl zone
  #
  echo "copying irl zone: "

  cd $OUT/irl.020
  scp db.10.205.12 db.irl root@$H:/etc/bind/zones/
  cd $OUT
hark's avatar
hark committed
64

yids's avatar
yids committed
65

hark's avatar
hark committed
66 67 68
  #
  # Copy static zones 
  #
yids's avatar
yids committed
69

hark's avatar
hark committed
70 71
  # Static zones
  scp $HFD/staticzones.conf root@$H:/etc/bind/zones/
hark's avatar
netzone  
hark committed
72

hark's avatar
hark committed
73 74
  #020.
  scp $STA/db.020 root@$H:/etc/bind/zones/
hark's avatar
netzone  
hark committed
75

hark's avatar
hark committed
76 77
  # squesh.net
  scp $STA/squesh.net.db root@$H:/etc/bind/zones/
yids's avatar
yids committed
78

hark's avatar
hark committed
79 80
  # squest.net
  scp $STA/net.020wireless.nl.db root@$H:/etc/bind/zones/
hark's avatar
netzone  
hark committed
81

hark's avatar
hark committed
82
done
hark's avatar
netzone  
hark committed
83

hark's avatar
hark committed
84 85 86 87 88 89 90 91 92
#
# reload configs
#
echo "reload trashbat: "
ssh root@trashbat /etc/init.d/bind9 reload
echo "reload stanleyH: "
ssh root@stanleyH /etc/init.d/named reload
echo "reload air traffic control: "
ssh root@atc /etc/init.d/bind9 reload
hark's avatar
hem  
hark committed
93 94 95 96
echo "reload kalium"
ssh root@kalium /etc/init.d/bind9 reload
ssh root@kalium host test.020