Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 2689 2019-01-20 10:50:15Z lucas.echard $
|
2 |
# $Id: alcasar.sh 2693 2019-01-28 16:43:48Z franck $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
5 |
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
# team@alcasar.net
|
7 |
# team@alcasar.net
|
Line 567... |
Line 567... |
567 |
DNS2=`cat /etc/sysconfig/network-scripts/ifcfg-$EXTIF | grep '^DNS2=' | cut -d"=" -f2` # 2nd DNS server
|
567 |
DNS2=`cat /etc/sysconfig/network-scripts/ifcfg-$EXTIF | grep '^DNS2=' | cut -d"=" -f2` # 2nd DNS server
|
568 |
else
|
568 |
else
|
569 |
DNS1=`cat /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF | grep '^DNS1=' | cut -d"=" -f2` # 1st DNS server
|
569 |
DNS1=`cat /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF | grep '^DNS1=' | cut -d"=" -f2` # 1st DNS server
|
570 |
DNS2=`cat /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF | grep '^DNS2=' | cut -d"=" -f2` # 2nd DNS server
|
570 |
DNS2=`cat /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF | grep '^DNS2=' | cut -d"=" -f2` # 2nd DNS server
|
571 |
fi
|
571 |
fi
|
572 |
if [ "$DNS1" == "" ]
|
- |
|
573 |
then
|
- |
|
574 |
if [ $Lang == "fr" ]
|
- |
|
575 |
then
|
- |
|
576 |
echo "L'adresse IP des serveurs DNS ne sont pas corrects"
|
- |
|
577 |
echo "Vérifiez la configuration de la carte réseau externe ($EXTIF)"
|
- |
|
578 |
else
|
- |
|
579 |
echo "The IP address of DNS servers are not set correctly"
|
- |
|
580 |
echo "Check the extern network card configuration ($EXTIF)"
|
- |
|
581 |
fi
|
- |
|
582 |
exit 0
|
- |
|
583 |
fi
|
- |
|
584 |
DNS1=${DNS1:=208.67.220.220}
|
572 |
DNS1=${DNS1:=208.67.220.220}
|
585 |
DNS2=${DNS2:=208.67.222.222}
|
573 |
DNS2=${DNS2:=208.67.222.222}
|
- |
|
574 |
# if [ "$DNS1" == "" ]
|
- |
|
575 |
# then
|
- |
|
576 |
# if [ $Lang == "fr" ]
|
- |
|
577 |
# then
|
- |
|
578 |
# echo "L'adresse IP des serveurs DNS ne sont pas corrects"
|
- |
|
579 |
# echo "Vérifiez la configuration de la carte réseau externe ($EXTIF)"
|
- |
|
580 |
# else
|
- |
|
581 |
# echo "The IP address of DNS servers are not set correctly"
|
- |
|
582 |
# echo "Check the extern network card configuration ($EXTIF)"
|
- |
|
583 |
# fi
|
- |
|
584 |
# exit 0
|
- |
|
585 |
# fi
|
586 |
PUBLIC_NETMASK=`/bin/ipcalc -m $PUBLIC_IP_MASK | cut -d"=" -f2`
|
586 |
PUBLIC_NETMASK=`/bin/ipcalc -m $PUBLIC_IP_MASK | cut -d"=" -f2`
|
587 |
PUBLIC_PREFIX=`/bin/ipcalc -p $PUBLIC_IP $PUBLIC_NETMASK|cut -d"=" -f2`
|
587 |
PUBLIC_PREFIX=`/bin/ipcalc -p $PUBLIC_IP $PUBLIC_NETMASK|cut -d"=" -f2`
|
588 |
PUBLIC_NETWORK=`/bin/ipcalc -n $PUBLIC_IP/$PUBLIC_PREFIX|cut -d"=" -f2`
|
588 |
PUBLIC_NETWORK=`/bin/ipcalc -n $PUBLIC_IP/$PUBLIC_PREFIX|cut -d"=" -f2`
|
589 |
# Write network parameters in the conf file
|
589 |
# Write network parameters in the conf file
|
590 |
echo "EXTIF=$EXTIF" >> $CONF_FILE
|
590 |
echo "EXTIF=$EXTIF" >> $CONF_FILE
|