Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1587 → Rev 1588

/scripts/alcasar-iptables.sh
26,17 → 26,10
then
PTN="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/([012]?[0-9]|3[0-2])\b"
public_ip_mask=`ip addr show $EXTIF | egrep -o $PTN`
dns1=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|head -n 1`
nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
if [ $nb_dns == 2 ]
then
dns2=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|tail -n 1`
fi
else
dns1=`grep ^DNS1= $CONF_FILE|cut -d"=" -f2`
dns2=`grep ^DNS2= $CONF_FILE|cut -d"=" -f2`
fi
PUBLIC_IP=`echo $public_ip_mask | cut -d"/" -f1`
dns1=`grep ^DNS1= $CONF_FILE|cut -d"=" -f2`
dns2=`grep ^DNS2= $CONF_FILE|cut -d"=" -f2`
dns1=${dns1:=208.67.220.220}
dns2=${dns2:=208.67.222.222}
DNSSERVERS="$dns1,$dns2" # first and second public DNS servers