nsbin/ssa/massen-reg.internetx
Nico Schottelius df2daf524d init
Signed-off-by: Nico Schottelius <nico@manager.schottelius.org>
2017-07-19 17:15:41 +02:00

28 lines
482 B
Bash
Executable file

#!/bin/sh
file=$1
named_file=/etc/bind/temp.conf
template=/home/server/named/templates/internetx
base_dir=/home/server/named
log=/var/log/syslog
for domain in `cat $file`; do
BASE=`echo $domain | sed 's/\..*$//g'`
EXT=`echo $domain | sed 's/.*\.\(.*\)/\1/g'`
# echo $BASE
# echo $EXT
cat << EOF >> "$named_file"
# schottelius
zone "$domain" {
type master;
file "$EXT/$BASE";
};
EOF
cp "$template" "$base_dir/$EXT/$BASE"
done
killall -HUP named &
tail -f $log