blob: af9f2d1b4a013b2d11d4298b7eb8cfb673a94ea3 (
plain)
- #!/bin/sh
- #
- # /usr/local/sbin/prim2sec.sh
- # Copyright 2002 Juri Jensen <juri@xenux.dk>
- # Tweaks by Jonas Smedegaard <dr@jones.dk>
- #
- # $Id: prim2sec.sh,v 1.4 2003-05-05 09:50:53 jonas Exp $
- #
- # Script to convert named.conf include file for primary nameserver
- # to a named.conf include file for secondary nameserver.
- primfile=$1
- primserver=$2
- if ! [ -f $primfile -a -n "$primserver" ]; then
- echo "Usage: `basename $0` primfile primserver > secfile"
- echo
- echo "Example: `basename $0` named_XENUX_pri.conf 195.184.98.98 > named_XENUX_sec.conf"
- exit 1
- fi
- domains=`cat $primfile | egrep '^zone[[:space:]]' | sed 's/^zone[[:space:]]\+"\([^"]\+\)".*/\1/' | sort`
- for domain in $domains; do
- echo "zone \"$domain\" { type slave; file \"db.$domain\"; masters { $primserver; }; };"
- done
|