]> mj.ucw.cz Git - nsc-5.git/blob - bin/nsconfig
d103f4d5bc51704d821b7d22186c5a1cd3666475
[nsc-5.git] / bin / nsconfig
1 #!/bin/bash
2 # NSC -- Makefile & Config file build script
3 # (c) 1997--2000 Martin Mares <mj@ucw.cz>
4
5 ROOT=/etc/named         # Root dir of the whole package
6 CF=cf                   # Place for all configuration files
7 ZONES=zone              # Place for all primary zone files
8 BAX=bak                 # Place for all secondary zone files
9 VERS=ver                # Place for all primary version files
10 NSC=m4                  # Place for all scripts
11
12 DOMAINS=$CF/domains     # The master domain list
13 MKFILE=Makefile         # Makefile to generate
14 CONFFILE=named.conf     # Configuration file to generate
15 CACHE=root.cache
16
17 M4=`which gm4` || M4=`which m4` || ( echo "Unable to find M4!" ; exit 1 )
18
19 if [ ! -f $DOMAINS ] ; then
20         echo "Domain list file missing."
21         exit 1
22         fi
23 m4 $NSC/dnslib.m4 $NSC/mkconf.m4 $DOMAINS >$CONFFILE -DZONEDIR=$ZONES -DBAKDIR=$BAX -DCACHE=$CACHE -DROOT=$ROOT
24 m4 $NSC/dnslib.m4 $NSC/mkmf.m4 $DOMAINS >$MKFILE -DZONEDIR=$ZONES -DBAKDIR=$BAX -DCACHE=$CACHE -DVERSDIR=$VERS -DNSCDIR=$NSC -DCONF=$CONFFILE -DCFDIR=$CF -DM4=$M4