Subversion Repositories ALCASAR

Rev

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

Rev 1543 Rev 1544
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1543 2014-12-23 10:06:16Z richard $ 
2
#  $Id: alcasar.sh 1544 2014-12-23 16:48:10Z 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 1283... Line 1283...
1283
	$SED "s?^# SKIPMIME.*?SKIPMIME image\/\* video\/\* audio\/\*?g" /etc/havp/havp.config # doesn't scan some multimedia files
1283
	$SED "s?^# SKIPMIME.*?SKIPMIME image\/\* video\/\* audio\/\*?g" /etc/havp/havp.config # doesn't scan some multimedia files
1284
# skip checking of youtube flow (too heavy load / risk too low)
1284
# skip checking of youtube flow (too heavy load / risk too low)
1285
	[ -e /etc/havp/whitelist.default ] || cp /etc/havp/whitelist /etc/havp/whitelist.default
1285
	[ -e /etc/havp/whitelist.default ] || cp /etc/havp/whitelist /etc/havp/whitelist.default
1286
	echo "# Whitelist youtube flow" >> /etc/havp/whitelist
1286
	echo "# Whitelist youtube flow" >> /etc/havp/whitelist
1287
	echo "*.youtube.com/*" >> /etc/havp/whitelist
1287
	echo "*.youtube.com/*" >> /etc/havp/whitelist
1288
# replacement of init script
1288
# adapt init script and systemd unit
1289
	[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
1289
	[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
1290
	cp -f $DIR_CONF/havp-init /etc/init.d/havp
1290
	cp -f $DIR_CONF/havp-init /etc/init.d/havp
-
 
1291
	$SED "/^PIDFile/i ExecStartPre=/bin/mkdir /var/run/havp" /lib/systemd/system/havp.service
-
 
1292
	$SED "/^PIDFile/i ExecStartPre=/bin/chown -R havp:havp /var/run/havp /var/log/havp" /lib/systemd/system/havp.service
1291
# replace of the intercept page (template)
1293
# replace of the intercept page (template)
1292
	cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
1294
	cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
1293
	cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
1295
	cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
1294
# update virus database every 4 hours (24h/6)
1296
# update virus database every 4 hours (24h/6)
1295
	[ -e /etc/freshclam.conf.default ] || cp /etc/freshclam.conf /etc/freshclam.conf.default
1297
	[ -e /etc/freshclam.conf.default ] || cp /etc/freshclam.conf /etc/freshclam.conf.default
Line 1326... Line 1328...
1326
	$SED "s?^#LogFile.*?LogFile \"/var/log/tinyproxy/tinyproxy.log\"?g" /etc/tinyproxy/tinyproxy.conf
1328
	$SED "s?^#LogFile.*?LogFile \"/var/log/tinyproxy/tinyproxy.log\"?g" /etc/tinyproxy/tinyproxy.conf
1327
	$SED "s?^#PidFile.*?PidFile \"/var/run/tinyproxy/tinyproxy.pid\"?g" /etc/tinyproxy/tinyproxy.conf
1329
	$SED "s?^#PidFile.*?PidFile \"/var/run/tinyproxy/tinyproxy.pid\"?g" /etc/tinyproxy/tinyproxy.conf
1328
	$SED "s?^LogLevel.*?LogLevel Error?g" /etc/tinyproxy/tinyproxy.conf		# Only errors are logged
1330
	$SED "s?^LogLevel.*?LogLevel Error?g" /etc/tinyproxy/tinyproxy.conf		# Only errors are logged
1329
	$SED "s?^#Upstream.*?Upstream 127.0.0.1:8090?g" /etc/tinyproxy/tinyproxy.conf	# forward to HAVP
1331
	$SED "s?^#Upstream.*?Upstream 127.0.0.1:8090?g" /etc/tinyproxy/tinyproxy.conf	# forward to HAVP
1330
	$SED "s?^#DisableViaHeader.*?DisableViaHeader Yes?g" /etc/tinyproxy/tinyproxy.conf	# Stealth mode
1332
	$SED "s?^#DisableViaHeader.*?DisableViaHeader Yes?g" /etc/tinyproxy/tinyproxy.conf	# Stealth mode
-
 
1333
	$SED "s?^Allow.*?Allow $PRIVATE_NETWORK_MASK?g" /etc/tinyproxy/tinyproxy.conf	# Allow from LAN
1331
# Create the systemd unit
1334
# Create the systemd unit
1332
cat << EOF > /lib/systemd/system/tinyproxy.service
1335
cat << EOF > /lib/systemd/system/tinyproxy.service
1333
#  This file is part of systemd.
1336
#  This file is part of systemd.
1334
#
1337
#
1335
#  systemd is free software; you can redistribute it and/or modify it
1338
#  systemd is free software; you can redistribute it and/or modify it
Line 1445... Line 1448...
1445
	cp $DIR_CONF/nfsen/SURFmap_v3.3.1.tar.gz /tmp/
1448
	cp $DIR_CONF/nfsen/SURFmap_v3.3.1.tar.gz /tmp/
1446
	cp $DIR_CONF/nfsen/GeoLiteCity* /tmp/
1449
	cp $DIR_CONF/nfsen/GeoLiteCity* /tmp/
1447
	tar xzf /tmp/SURFmap_v3.3.1.tar.gz -C /tmp/
1450
	tar xzf /tmp/SURFmap_v3.3.1.tar.gz -C /tmp/
1448
	cd /tmp/
1451
	cd /tmp/
1449
	/usr/bin/sh SURFmap/install.sh
1452
	/usr/bin/sh SURFmap/install.sh
1450
chown -R apache:apache /var/www/html/acc/manager/nfsen
1453
chown -R apache:apache /var/www/html/acc/manager/nfsen /usr/share/nfsen
1451
# clear the installation
1454
# clear the installation
1452
	cd $DirTmp
1455
	cd $DirTmp
1453
	rm -rf /tmp/nfsen*
1456
	rm -rf /tmp/nfsen*
1454
	rm -rf /tmp/SURFmap*
1457
	rm -rf /tmp/SURFmap*
1455
} # End of nfsen ()
1458
} # End of nfsen ()
Line 2036... Line 2039...
2036
		exit 0
2039
		exit 0
2037
		;;
2040
		;;
2038
	-i | --install)
2041
	-i | --install)
2039
		header_install
2042
		header_install
2040
		license
2043
		license
-
 
2044
		header_install
2041
		testing
2045
		testing
2042
# RPMs install
2046
# RPMs install
2043
		$DIR_SCRIPTS/alcasar-urpmi.sh
2047
		$DIR_SCRIPTS/alcasar-urpmi.sh
2044
		if [ "$?" != "0" ]
2048
		if [ "$?" != "0" ]
2045
		then
2049
		then