Subversion Repositories ALCASAR

Rev

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

Rev 2825 Rev 2826
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2825 2020-05-31 17:01:33Z rexy $
2
#  $Id: alcasar.sh 2826 2020-06-01 20:44:27Z 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 2392... Line 2392...
2392
	fi
2392
	fi
2393
# Test if manual update
2393
# Test if manual update
2394
		if [ -e /var/tmp/alcasar-conf*.tar.gz ] && [ "$mode" == "install" ]
2394
		if [ -e /var/tmp/alcasar-conf*.tar.gz ] && [ "$mode" == "install" ]
2395
		then
2395
		then
2396
			header_install
2396
			header_install
-
 
2397
# Extract some info from the previous configuration file
-
 
2398
			tar -xf /var/tmp/alcasar-conf* conf/etc/alcasar.conf
-
 
2399
			ORGANISME=`grep ^ORGANISM= conf/etc/alcasar.conf|cut -d"=" -f2`
-
 
2400
			PREVIOUS_VERSION=`grep ^VERSION= conf/etc/alcasar.conf|cut -d"=" -f2`
-
 
2401
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
-
 
2402
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2`
-
 
2403
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3|cut -c1`
2397
			if [ $Lang == "fr" ]
2404
			if [ $Lang == "fr" ]
2398
				then echo "Le fichier de configuration d'une ancienne version a été trouvé";
2405
				then echo "Le fichier de configuration d'une version $MAJ_PREVIOUS_VERSION.$MIN_PREVIOUS_VERSION.$UPD_PREVIOUS_VERSION a été trouvé";
2399
				else echo "The configuration file of an old version has been found";
2406
				else echo "The configuration file of an old version has been found";
2400
			fi
2407
			fi
2401
			response=0
2408
			response=0
2402
			PTN='^[oOnNyY]?$'
2409
			PTN='^[oOnNyY]?$'
2403
			until [[ "$response" =~ $PTN ]]
2410
			until [[ "$response" =~ $PTN ]]
Line 2417... Line 2424...
2417
		then
2424
		then
2418
			if [ $Lang == "fr" ]
2425
			if [ $Lang == "fr" ]
2419
				then echo "#### Installation avec mise à jour ####";
2426
				then echo "#### Installation avec mise à jour ####";
2420
				else echo "#### Installation with update     ####";
2427
				else echo "#### Installation with update     ####";
2421
			fi
2428
			fi
2422
# Extract some info from the previous configuration file
-
 
2423
			tar -xf /var/tmp/alcasar-conf* conf/etc/alcasar.conf
-
 
2424
			ORGANISME=`grep ^ORGANISM= conf/etc/alcasar.conf|cut -d"=" -f2`
-
 
2425
			PREVIOUS_VERSION=`grep ^VERSION= conf/etc/alcasar.conf|cut -d"=" -f2`
-
 
2426
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
-
 
2427
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2`
-
 
2428
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3|cut -c1`
-
 
2429
			mode="update"
2429
			mode="update"
2430
		fi
2430
		fi
2431
		for func in init network CA ACC time_server init_db freeradius chilli e2guardian antivirus tinyproxy ulogd nfsen vnstat dnsmasq unbound dhcpd BL cron fail2ban gammu_smsd msec letsencrypt post_install
2431
		for func in init network CA ACC time_server init_db freeradius chilli e2guardian antivirus tinyproxy ulogd nfsen vnstat dnsmasq unbound dhcpd BL cron fail2ban gammu_smsd msec letsencrypt post_install
2432
		do
2432
		do
2433
			$func
2433
			$func