Subversion Repositories ALCASAR

Rev

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

Rev 1540 Rev 1541
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1540 2014-12-22 15:38:02Z richard $ 
2
#  $Id: alcasar.sh 1541 2014-12-22 16:47:41Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 39... Line 39...
39
#	antivirus		: HAVP + libclamav configuration
39
#	antivirus		: HAVP + libclamav configuration
40
#	tinyproxy		: little proxy for user filtered with "WL + antivirus" and "antivirus"
40
#	tinyproxy		: little proxy for user filtered with "WL + antivirus" and "antivirus"
41
#	ulogd			: log system in userland (match NFLOG target of iptables)
41
#	ulogd			: log system in userland (match NFLOG target of iptables)
42
#	nfsen		:	: Configuration du grapheur nfsen pour apache 
42
#	nfsen		:	: Configuration du grapheur nfsen pour apache 
43
#	dnsmasq			: Name server configuration
43
#	dnsmasq			: Name server configuration
-
 
44
#	vnstat			: little network stat daemon
44
#	BL			: BlackList of Toulouse configuration : split into 3 BL (for Dnsmasq, for dansguardian and for Netfilter)
45
#	BL			: BlackList of Toulouse configuration : split into 3 BL (for Dnsmasq, for dansguardian and for Netfilter)
45
#	cron			: Logs export + watchdog + connexion statistics
46
#	cron			: Logs export + watchdog + connexion statistics
46
#	fail2ban		: Fail2ban IDS installation and configuration
47
#	fail2ban		: Fail2ban IDS installation and configuration
47
#	gammu_smsd		: Autoregister addon via SMS (gammu-smsd)
48
#	gammu_smsd		: Autoregister addon via SMS (gammu-smsd)
48
#	post_install		: Security, log rotation, etc.
49
#	post_install		: Security, log rotation, etc.
Line 830... Line 831...
830
	ErrorDocument 404 https://$HOSTNAME.$DOMAIN/
831
	ErrorDocument 404 https://$HOSTNAME.$DOMAIN/
831
</Directory>
832
</Directory>
832
EOF
833
EOF
833
# Launch after coova
834
# Launch after coova
834
$SED "s?^After=.*?After=network.target remote-fs.target nss-lookup.target chilli.service?g" /lib/systemd/system/httpd.service
835
$SED "s?^After=.*?After=network.target remote-fs.target nss-lookup.target chilli.service?g" /lib/systemd/system/httpd.service
835
# Initialization of Vnstat and vnstat phpFE
-
 
836
	 [ -e /etc/vnstat.conf.default ] || cp /etc/vnstat.conf /etc/vnstat.conf.default
-
 
837
	 $SED "s?Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf
-
 
838
	 [ -e /var/www/html/acc/manager/stats/config.php.default ] || cp /var/www/html/acc/manager/stats/config.php /var/www/html/acc/manager/stats/config.php.default
-
 
839
	 $SED "s?\$iface_list =.*?\$iface_list = array('$EXTIF');?g" /var/www/html/acc/manager/stats/config.php
-
 
840
	 $SED "s?\$iface_title.*?\$iface_title['$EXTIF'] = 'Internet outbound';?g" /var/www/html/acc/manager/stats/config.php
-
 
841
	/usr/bin/vnstat -u -i $EXTIF
-
 
842
} # End of ACC ()
836
} # End of ACC ()
843
 
837
 
844
##########################################################################################
838
##########################################################################################
845
##				Fonction "CA"						##
839
##				Fonction "CA"						##
846
## - Création d'une Autorité de Certification et du certificat serveur pour apache 	##
840
## - Création d'une Autorité de Certification et du certificat serveur pour apache 	##
Line 1459... Line 1453...
1459
	rm -rf /tmp/nfsen*
1453
	rm -rf /tmp/nfsen*
1460
	rm -rf /tmp/SURFmap*
1454
	rm -rf /tmp/SURFmap*
1461
} # End of nfsen ()
1455
} # End of nfsen ()
1462
 
1456
 
1463
##################################################
1457
##################################################
-
 
1458
##		Function "vnstat"		##
-
 
1459
## Initialization of Vnstat and vnstat phpFE    ##
-
 
1460
##################################################
-
 
1461
vnstat ()
-
 
1462
{
-
 
1463
	 [ -e /etc/vnstat.conf.default ] || cp /etc/vnstat.conf /etc/vnstat.conf.default
-
 
1464
	 $SED "s?Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf
-
 
1465
	 [ -e $DIR_ACC/manager/stats/config.php.default ] || cp $DIR_ACC/manager/stats/config.php $DIR_ACC/manager/stats/config.php.default
-
 
1466
	 $SED "s?\$iface_list =.*?\$iface_list = array('$EXTIF');?g" $DIR_ACC/manager/stats/config.php
-
 
1467
	 $SED "s?\$iface_title.*?\$iface_title['$EXTIF'] = 'Internet outbound';?g" $DIR_ACC/manager/stats/config.php
-
 
1468
	/usr/bin/vnstat -u -i $EXTIF
-
 
1469
} # End of vnstat	
-
 
1470
##################################################
1464
##		Function "dnsmasq"		##
1471
##		Function "dnsmasq"		##
1465
##################################################
1472
##################################################
1466
dnsmasq ()
1473
dnsmasq ()
1467
{
1474
{
1468
	[ -d /var/log/dnsmasq ] || mkdir /var/log/dnsmasq
1475
	[ -d /var/log/dnsmasq ] || mkdir /var/log/dnsmasq
Line 2079... Line 2086...
2079
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
2086
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
2080
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
2087
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
2081
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`
2088
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`
2082
			mode="update"
2089
			mode="update"
2083
		fi
2090
		fi
2084
		for func in init network ACC CA init_db radius radius_web chilli dansguardian antivirus tinyproxy ulogd nfsen dnsmasq BL cron fail2ban gammu_smsd post_install
2091
		for func in init network ACC CA init_db radius radius_web chilli dansguardian antivirus tinyproxy ulogd nfsen vnstat dnsmasq BL cron fail2ban gammu_smsd post_install
2085
		do
2092
		do
2086
			$func
2093
			$func
2087
# echo "*** 'debug' : end of function $func ***"; read a
2094
# echo "*** 'debug' : end of function $func ***"; read a
2088
		done
2095
		done
2089
		;;
2096
		;;