df2daf524d
Signed-off-by: Nico Schottelius <nico@manager.schottelius.org>
28 lines
482 B
Bash
Executable file
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
|