X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=bin%2Fnsconfig;h=229dc3619f12ca8bec5d4e88866f219911d1eef0;hb=57e60f9a9bd96a6cd81651dfd8b833ea82c509c6;hp=8f09889f8eb1493e2753e60ff03240c398bbb241;hpb=ded4fe1add43222e47f4105aac673428c60c4f2e;p=nsc-5.git diff --git a/bin/nsconfig b/bin/nsconfig index 8f09889..229dc36 100755 --- a/bin/nsconfig +++ b/bin/nsconfig @@ -1,21 +1,18 @@ -# NSC 2.0 -- Makefile & Config file build script -# (c) 1997 Martin Mares +#!/bin/sh +# NSC -- Makefile & Config file build script +# (c) 1997--2019 Martin Mares -ROOT=/etc/named # Root dir of the whole package -CF=cf # Place for all configuration files -ZONES=zone # Place for all primary zone files -BAX=bak # Place for all secondary zone files -VERS=ver # Place for all primary version files -NSC=m4 # Place for all scripts +set -e -DOMAINS=$CF/domains # The master domain list -MKFILE=Makefile # Makefile to generate -CONFFILE=named.conf # Configuration file to generate -CACHE=root.cache +M4=`which gm4` || M4=`which m4` || ( echo "Unable to find M4!" ; exit 1 ) +DOMAINS=cf/domains -if [ \! -f $DOMAINS ] ; then +if [ ! -f $DOMAINS ] ; then echo "Domain list file missing." exit 1 fi -m4 $NSC/dnslib.m4 $NSC/mkconf.m4 $DOMAINS >$CONFFILE -DZONEDIR=$ZONES -DBAKDIR=$BAX -DCACHE=$CACHE -DROOT=$ROOT -m4 $NSC/dnslib.m4 $NSC/mkmf.m4 $DOMAINS >$MKFILE -DZONEDIR=$ZONES -DBAKDIR=$BAX -DCACHE=$CACHE -DVERSDIR=$VERS -DNSCDIR=$NSC -DCONF=$CONFFILE -DCFDIR=$CF + +mkdir -p zone bak hash ver keys khash dss tmp +$M4 m4/mkconf.m4 $DOMAINS >named.conf +$M4 m4/mkmf.m4 $DOMAINS >Makefile +$M4 -DM4=$M4 m4/mkshell-env.m4 >bin/shell-env