#!/bin/sh # # CacheBuild # By: Paul Balyoz # Copyright (c) 1993-1995 by Paul A. Balyoz # # rev RPH -- Owl River Company -- 990818 for Linux # # NOTE: ADJUST PATH BEFORE INSTALLING, if needed! # This must include the directory where "nslookup" lives. PATH=/bin:/usr/bin:/usr/local/bin export PATH NAMEDPATH="/var/named" # Name of file to write the new root cache into # (macroed in by Makefile) OUT="root.cache" # Front part of the name of the awk script we need to run # (macroed in by Makefile) AWKSCR="/usr/local/lib/cachebuild.awk" # -------------------------------------------------------------------------- cd $NAMEDPATH # Rotate filenames of any old root.cache files in current directory rm -f $OUT.older if test -f $OUT.old; then mv $OUT.old $OUT.older fi if test -f $OUT; then mv $OUT $OUT.old fi # Generate comment lines at top of root.cache echo ";" > $OUT echo "; root.cache built by $USER@`hostname` on `date`" >> $OUT echo "; Automatically built by cachebuild, any changes you make may go away." >> $OUT echo ";" >> $OUT echo "" >> $OUT # Generate body lines of root.cache and deal with errors. nslookup << EOF | awk -f $AWKSCR >> $OUT set type=NS root . EOF err=$? if test $err -ne 0; then echo "Call to nslookup failed." rm -f $OUT fi exit $err