xcat-core/xCAT-server/sbin/makenamed.conf

33 lines
610 B
Plaintext
Raw Normal View History

#!/bin/sh
DIRECTORY=/var/named
if [ -f /etc/SuSE-release ]; then
DIRECTORY=/var/lib
fi
FILE=/etc/named.conf
#unalias cp
if [ -f $FILE ]; then
cp -f $FILE ${FILE}.ORIG
fi
if [ ! -d /var/named ]; then
mkdir "/var/named"
fi
echo "options {
directory \"$DIRECTORY\";
dump-file \"$DIRECTORY/data/cache_dump.db\";
statistics-file \"$DIRECTORY/data/named_stats.txt\";
memstatistics-file \"$DIRECTORY/data/named_mem_stats.txt\";
recursion yes;
forward only;
forwarders {" >$FILE
for i in $(grep "^nameserver" /etc/resolv.conf | awk '{print $2}')
do
echo " $i;"
done >>$FILE
echo " };
};" >>$FILE