#!/bin/sh
#erstellt /etc/bind/named.conf.options
set $(cat /tmp/ipsub_intern.txt | tr "/" " ")
IP_INT=$1
SUB_INT=$2
set $(cat /tmp/ipsub_extern.txt | tr "/" " ")
IP_EXT=$1
SUB_EXT=$2
set $(echo $IP_INT | tr "." " ")
IP_INT_LAST=$4
IP_INT_LAST_P=`expr $4 + 1` IP_PARTNER=$1.$2.$3.$IP_INT_LAST_P
rm -f /etc/bind/named.conf.options
cp /KNOPPIX/etc/bind/named.conf.options /etc/bind/
echo "options {" > /etc/bind/named.conf.options
echo " directory \"/var/cache/bind\";" >> /etc/bind/named.conf.options
echo " fetch-glue no;" >> /etc/bind/named.conf.options
echo " forwarders {" >> /etc/bind/named.conf.options
echo " 192.168.216.254;" >> /etc/bind/named.conf.options
echo " };" >> /etc/bind/named.conf.options
echo " listen-on {" >> /etc/bind/named.conf.options
echo " 127.0.0.1;" >> /etc/bind/named.conf.options
echo " $IP_EXT;" >> /etc/bind/named.conf.options
echo " };" >> /etc/bind/named.conf.options
echo " allow-transfer {" >> /etc/bind/named.conf.options
echo " 127.0.0.1;" >> /etc/bind/named.conf.options
echo " 192.168.216.254;" >> /etc/bind/named.conf.options
echo " $IP_EXT;" >> /etc/bind/named.conf.options
echo " $IP_PARTNER;" >> /etc/bind/named.conf.options
echo " };" >> /etc/bind/named.conf.options
echo " allow-query {" >> /etc/bind/named.conf.options
echo " 127.0.0.1;" >> /etc/bind/named.conf.options
echo " 192.168.216.254;" >> /etc/bind/named.conf.options
echo " $IP_EXT;" >> /etc/bind/named.conf.options
echo " };" >> /etc/bind/named.conf.options
echo "};" >> /etc/bind/named.conf.options