Subversion Repositories ALCASAR

Rev

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

Rev 1383 Rev 1384
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1383 2014-06-11 22:30:51Z richard $ 
2
#  $Id: alcasar.sh 1384 2014-06-12 08:00:06Z 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 1392... Line 1392...
1392
##########################################################
1392
##########################################################
1393
##		Fonction "BL"				##
1393
##		Fonction "BL"				##
1394
##########################################################
1394
##########################################################
1395
BL ()
1395
BL ()
1396
{
1396
{
-
 
1397
# modify iptables init script in order to load the ipsets
-
 
1398
[ -e /usr/libexec/iptables.init.default ] || cp /usr/libexec/iptables.init /usr/libexec/iptables.init.default
-
 
1399
sed -i 's/^IPTABLES_CONFIG=\/etc\/sysconfig\/iptables/IPTABLES_CONFIG=\/etc\/sysconfig\/iptables\nIPSET_CONFIG=\/etc\/sysconfig\/ipset_save/' /usr/libexec/iptables.init
-
 
1400
sed -i 's/if \[ -f \$IPTABLES_CONFIG \]; then/if \[ -f \$IPSET_CONFIG \] \&\& \[ -f \$IPTABLES_CONFIG \]; then\n\t\t\/sbin\/ipset -! restore < \$IPSET_CONFIG/' /usr/libexec/iptables.init
1397
# copy and extract of Toulouse BL
1401
# copy and extract toulouse BL
1398
	rm -rf $DIR_DG/lists/blacklists
1402
	rm -rf $DIR_DG/lists/blacklists
1399
	tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
1403
	tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
1400
# creation of the OSSI BL and WL categories (domain name and url)
1404
# creation of the OSSI BL and WL categories (domain name and url)
1401
	mkdir $DIR_DG/lists/blacklists/ossi
1405
	mkdir $DIR_DG/lists/blacklists/ossi
1402
	touch $DIR_DG/lists/blacklists/ossi/domains $DIR_DG/lists/blacklists/ossi/domains_wl
1406
	touch $DIR_DG/lists/blacklists/ossi/domains $DIR_DG/lists/blacklists/ossi/domains_wl
1403
	touch $DIR_DG/lists/blacklists/ossi/urls $DIR_DG/lists/blacklists/ossi/urls_wl
1407
	touch $DIR_DG/lists/blacklists/ossi/urls $DIR_DG/lists/blacklists/ossi/urls_wl
-
 
1408
	touch $DIR_DEST_SHARE/iptables-wl/ossi
-
 
1409
	chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
-
 
1410
	chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
1404
# creation of file for the rehabilited domains and urls
1411
# creation of file for the rehabilited domains and urls
1405
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1412
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1406
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1413
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1407
	touch $DIR_DG/lists/exceptionsitelist
1414
	touch $DIR_DG/lists/exceptionsitelist
1408
	touch $DIR_DG/lists/exceptionurllist
1415
	touch $DIR_DG/lists/exceptionurllist
Line 1428... Line 1435...
1428
# Youtube - add 'edufilter=your_ID' 
1435
# Youtube - add 'edufilter=your_ID' 
1429
#"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
1436
#"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
1430
EOF
1437
EOF
1431
# change the the google safesearch ("safe=strict" instead of "safe=vss")
1438
# change the the google safesearch ("safe=strict" instead of "safe=vss")
1432
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1439
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1433
	chown -R dansguardian:apache $DIR_DG
-
 
1434
	chmod -R g+rw $DIR_DG
-
 
1435
# adapt the BL to ALCASAR architecture. Enable the default categories
1440
# adapt the BL to ALCASAR architecture. Enable the default categories
1436
	if [ "$mode" != "update" ]; then
1441
	if [ "$mode" != "update" ]; then
1437
		$DIR_DEST_SBIN/alcasar-bl.sh --adapt
1442
		$DIR_DEST_SBIN/alcasar-bl.sh --adapt
1438
		$DIR_DEST_SBIN/alcasar-bl.sh --cat_choice
1443
		$DIR_DEST_SBIN/alcasar-bl.sh --cat_choice
-
 
1444
		$DIR_DEST_SBIN/alcasar-bl.sh --ip_retrieving
1439
	fi
1445
	fi
1440
}
1446
}
1441
 
1447
 
1442
##########################################################
1448
##########################################################
1443
##		Fonction "cron"				##
1449
##		Fonction "cron"				##