Subversion Repositories ALCASAR

Rev

Rev 2941 | Rev 2956 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2941 Rev 2947
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2941 2021-04-12 17:21:42Z rexy $
2
#  $Id: alcasar.sh 2947 2021-04-21 16:36:52Z rexy $
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 587... Line 587...
587
		then echo "LANIF=$LANIF" >> $CONF_FILE
587
		then echo "LANIF=$LANIF" >> $CONF_FILE
588
	fi
588
	fi
589
	IP_SETTING=`grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2` # test static or dynamic
589
	IP_SETTING=`grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2` # test static or dynamic
590
	if [ $IP_SETTING == "dhcp" ]
590
	if [ $IP_SETTING == "dhcp" ]
591
	then
591
	then
-
 
592
		DHCP_DNS_servers=`cat /var/lib/dhclient/dhclient--$EXTIF.lease |grep domain-name-servers|sed -n "1 p"| rev|cut -d" " -f1|rev|tr -d ';'`
-
 
593
		DNS1=`echo $DHCP_DNS_servers | cut -d"," -f1`
-
 
594
		DNS2=`echo $DHCP_DNS_servers | cut -d"," -f2`
592
		echo "PUBLIC_IP=dhcp" >> $CONF_FILE
595
		echo "PUBLIC_IP=dhcp" >> $CONF_FILE
593
		echo "GW=dhcp" >> $CONF_FILE
596
		echo "GW=dhcp" >> $CONF_FILE
594
	else
597
	else
595
		echo "PUBLIC_IP=$PUBLIC_IP/$PUBLIC_PREFIX" >> $CONF_FILE
598
		echo "PUBLIC_IP=$PUBLIC_IP/$PUBLIC_PREFIX" >> $CONF_FILE
596
		echo "GW=$PUBLIC_GATEWAY" >> $CONF_FILE
599
		echo "GW=$PUBLIC_GATEWAY" >> $CONF_FILE