make.sh 1.45 KB
Newer Older
hark's avatar
hark committed
1 2
#!/bin/bash 
#set -e
hark's avatar
hark committed
3 4
. paths.sh

Imre Jonk's avatar
Imre Jonk committed
5
HOSTS="bprouter soerel"
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

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
}



make_zone () {
  # 1 hostfile.irl
  # 2 irl.020
  # 3 10.205.12:255.255.0.0 (don't put leading 0's in subnet)
  # 4
  hostfile=$1
  zone_name=$2
  subnet=$3

  mkdir $OUT/$zone_name
  cd $OUT/$zone_name && rm *

  $BIN/h2n -d $zone_name \
    -m 10:mail.$zone_name \
    -n $subnet      \
    -h 10.205.253.1   \
    -s 10.205.253.1   \
hark's avatar
hark committed
37
    -v 8 -y           \
38 39 40 41 42 43 44 45 46 47 48 49 50
    -H $HFD/$hostfile    \
    -u wireless-amsterdam@lists.puscii.nl   \
    -M -t

  shortname="!todo!"
  echo "made: "
  ls -lh $OUT/$zone_name
  echo "   $OUT/$zone_name/db.$shortname"
  echo "   $OUT/$zone_name/db.$shortname"

  cd $OUT

}
hark's avatar
hark committed
51 52

#routers /radios /etc.
hark's avatar
hark committed
53 54
make_zone routers routers.020 10.205.253:255.255.255.0
make_zone transfernet transfernet.020 10.205.255:255.255.255.0
hark's avatar
hark committed
55 56
#is same subnet as transfernet
#make_zone hostfile.radio radio.020 10.205.255:255.255.255.0
hark's avatar
hark committed
57

hark's avatar
hark committed
58 59 60
# acta vlan1
make_zone vlan1acta vlan1acta.020 192.168.88:255.255.255.0
make_zone amsw amsw.020 10.205.252:255.255.255.0
hark's avatar
hark committed
61 62 63 64 65 66


#
# irl.squesh.net zone
# 

hark's avatar
hark committed
67 68
make_zone irl irl.020 10.205.12:255.255.255.0:
make_zone irl irl.squesh.net 10.205.12:255.255.255.0
hark's avatar
hark committed
69 70

#ki zone
hark's avatar
hark committed
71 72 73 74
make_zone ki ki.020 10.205.14:255.255.255.0
make_zone ki ki.squesh.net 10.205.14:255.255.255.0

make_zone wfc wfc.020 10.205.9:255.255.255.0
hark's avatar
hark committed
75 76