Subversion Repositories ALCASAR

Rev

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

Rev 1905 Rev 1912
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1905 2016-05-19 12:51:40Z raphael.pion $ 
2
#  $Id: alcasar.sh 1912 2016-05-29 13:18:17Z 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 1596... Line 1596...
1596
BL ()
1596
BL ()
1597
{
1597
{
1598
# copy and extract Toulouse university BL
1598
# copy and extract Toulouse university BL
1599
	rm -rf $DIR_DG/lists/blacklists
1599
	rm -rf $DIR_DG/lists/blacklists
1600
	tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
1600
	tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
1601
# creation of the OSSI BL and WL categories (domain name and url)
-
 
1602
	mkdir $DIR_DG/lists/blacklists/ossi
-
 
1603
	touch $DIR_DG/lists/blacklists/ossi/domains
-
 
1604
	touch $DIR_DG/lists/blacklists/ossi/urls
-
 
1605
	chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
-
 
1606
	chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
-
 
1607
# creation of file for the rehabilited domains and urls
1601
# creation of file for the rehabilited domains and urls
1608
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1602
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1609
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1603
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1610
	touch $DIR_DG/lists/exceptionsitelist
1604
	touch $DIR_DG/lists/exceptionsitelist
1611
	touch $DIR_DG/lists/exceptionurllist
1605
	touch $DIR_DG/lists/exceptionurllist
Line 1629... Line 1623...
1629
# Bing - add 'adlt=strict'
1623
# Bing - add 'adlt=strict'
1630
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
1624
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
1631
EOF
1625
EOF
1632
# change the the google safesearch ("safe=strict" instead of "safe=vss")
1626
# change the the google safesearch ("safe=strict" instead of "safe=vss")
1633
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1627
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1634
# adapt the BL to ALCASAR architecture. Enable the default categories
1628
# adapt the Toulouse BL to ALCASAR architecture. Enable the default categories
1635
	if [ "$mode" != "update" ]; then
1629
	if [ "$mode" != "update" ]; then
1636
		$DIR_DEST_BIN/alcasar-bl.sh --adapt
1630
		$DIR_DEST_BIN/alcasar-bl.sh --adapt
1637
		$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
1631
		$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
-
 
1632
# creation of the custom BL and WL categorie named "ossi" (for domain names & ip only)
-
 
1633
		touch $DIR_DEST_SHARE/dnsmasq-bl/ossi.conf
-
 
1634
		touch $DIR_DEST_SHARE/dnsmasq-wl/ossi.conf
-
 
1635
		touch $DIR_DEST_SHARE/iptables-bl/ossi
-
 
1636
		touch $DIR_DEST_SHARE/iptables-wl/ossi
-
 
1637
# add custom ALCASAR BL files (TOR)
1638
		mv $DIR_CONF/ossi-tor_node_ip  $DIR_DEST_SHARE/iptables-bl-enabled/
1638
		mv $DIR_CONF/ossi-tor_node_ip  $DIR_DEST_SHARE/iptables-bl/
1639
		chown dansguardian:apache $DIR_DEST_SHARE/iptables-bl-enabled/ossi-tor_node_ip
1639
		chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
1640
		chmod g+w $DIR_DEST_SHARE/iptables-bl-enabled/ossi-tor_node_ip
1640
		chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
1641
	fi
1641
	fi
1642
}
1642
}
1643
 
1643
 
1644
##########################################################
1644
##########################################################
1645
##		Fonction "cron"				##
1645
##		Fonction "cron"				##