Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 672 → Rev 673

/scripts/alcasar-conf.sh
1,6 → 1,5
#/bin/bash
# $Id$
# $Author$
 
# alcasar-conf.sh
# by Richard REY
255,7 → 254,7
exit 0
fi
DNS1=`grep DNS1 $CONF_FILE|cut -d"=" -f2`
check=$(echo $PUBLIC_GATEWAY | egrep $PTN)
check=$(echo $DNS1 | egrep $PTN)
if [[ "$?" -ne 0 ]]
then
echo "Syntax error for the IP address of the first DNS server ($DNS1)"
262,7 → 261,7
exit 0
fi
DNS2=`grep DNS2 $CONF_FILE|cut -d"=" -f2`
check=$(echo $PUBLIC_GATEWAY | egrep $PTN)
check=$(echo $DNS2 | egrep $PTN)
if [[ "$?" -ne 0 ]]
then
echo "Syntax error for the IP address of the second DNS server ($DNS2)"
326,8 → 325,12
$SED "s?^HostAliases=.*?HostAliases=\"$PRIVATE_IP\"?g" /etc/awstats/awstats.conf
# dnsmasq
$SED "/127.0.0.1/!s?^listen-address=.*?listen-address=$PRIVATE_IP?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
$SED "s?^server=.*?server=$DNS1?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
$SED "/$DNS1/!s?^server=.*?server=$DNS2?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
for i in /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
do
$SED "/^server=/d" $i
echo "server=$DNS1" >> $i
echo "server=$DNS2" >> $i
done
$SED "s?^dhcp-range=.*?dhcp-range=$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h?g" /etc/dnsmasq.conf
$SED "s?^dhcp-option=option:router.*?dhcp-option=option:router,$PRIVATE_IP?g" /etc/dnsmasq.conf
# DG + BL