Subversion Repositories ALCASAR

Rev

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

Rev 1955 Rev 1957
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1955 2016-06-20 22:10:50Z richard $ 
2
#  $Id: alcasar.sh 1957 2016-06-21 22:16: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 186... Line 186...
186
			echo
186
			echo
187
			if [ $Lang == "fr" ]
187
			if [ $Lang == "fr" ]
188
				then	
188
				then	
189
				echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
189
				echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
190
				echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
190
				echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
191
				echo "2 - Installez Linux-Mageia 4.1 (cf. doc d'installation)"
191
				echo "2 - Installez Linux-Mageia 5 (cf. doc d'installation)"
192
				echo "3 - recopiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
192
				echo "3 - recopiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
193
			else
193
			else
194
				echo "The automatic update of ALCASAR can't be performed."
194
				echo "The automatic update of ALCASAR can't be performed."
195
				echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
195
				echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
196
				echo "2 - Install Linux-Mageia 4.1 (cf. installation doc)"
196
				echo "2 - Install Linux-Mageia 5 (cf. installation doc)"
197
				echo "3 - Copy again the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
197
				echo "3 - Copy again the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
198
			fi
198
			fi
199
		else
199
		else
200
			if [ $Lang == "fr" ]
200
			if [ $Lang == "fr" ]
201
				then	
201
				then	
Line 1631... Line 1631...
1631
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
1631
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
1632
EOF
1632
EOF
1633
# change the google safesearch ("safe=strict" instead of "safe=vss")
1633
# change the google safesearch ("safe=strict" instead of "safe=vss")
1634
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1634
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1635
# creation of the custom BL and WL categorie named "ossi" (for domain names & ip only)
1635
# creation of the custom BL and WL categorie named "ossi" (for domain names & ip only)
1636
	if [ "$mode" != "update" ]; then
-
 
1637
		mkdir -p $DIR_DG/lists/blacklists/ossi-bl
1636
	mkdir -p $DIR_DG/lists/blacklists/ossi-bl
1638
		touch $DIR_DG/lists/blacklists/ossi-bl/domains
1637
	touch $DIR_DG/lists/blacklists/ossi-bl/domains
1639
		echo "ossi-bl" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
1638
	echo "ossi-bl" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
1640
		mkdir -p $DIR_DG/lists/blacklists/ossi-wl
1639
	mkdir -p $DIR_DG/lists/blacklists/ossi-wl
1641
		touch $DIR_DG/lists/blacklists/ossi-wl/domains
1640
	touch $DIR_DG/lists/blacklists/ossi-wl/domains
1642
		echo "ossi-wl" >> $DIR_DEST_ETC/alcasar-wl-categories-enabled
1641
	echo "ossi-wl" >> $DIR_DEST_ETC/alcasar-wl-categories-enabled
1643
# add custom ALCASAR BL files
1642
# add custom ALCASAR BL files
1644
		for x in $(ls $DIR_BLACKLIST | grep -v "^blacklist")
1643
	for x in $(ls $DIR_BLACKLIST | grep -v "^blacklist")
1645
		do
1644
	do
1646
			mkdir $DIR_DG/lists/blacklists/ossi-bl-$x
1645
		mkdir $DIR_DG/lists/blacklists/ossi-bl-$x
1647
			cp $DIR_BLACKLIST/$x  $DIR_DG/lists/blacklists/ossi-bl-$x/domains
1646
		cp $DIR_BLACKLIST/$x  $DIR_DG/lists/blacklists/ossi-bl-$x/domains
1648
			echo "ossi-bl-$x" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
1647
		echo "ossi-bl-$x" >> $DIR_DEST_ETC/alcasar-bl-categories-enabled
1649
		done
1648
	done
1650
		chown -R dansguardian:apache $DIR_DG
1649
	chown -R dansguardian:apache $DIR_DG
1651
		chown -R root:apache $DIR_DEST_SHARE
1650
	chown -R root:apache $DIR_DEST_SHARE
1652
		chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
1651
	chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
1653
# adapt the Toulouse BL to ALCASAR architecture
1652
# adapt the Toulouse BL to ALCASAR architecture
1654
		$DIR_DEST_BIN/alcasar-bl.sh --adapt
1653
	$DIR_DEST_BIN/alcasar-bl.sh --adapt
1655
# enable the default categories
1654
# enable the default categories
1656
		$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
1655
	$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
1657
	fi
-
 
1658
}
1656
}
1659
 
1657
 
1660
##########################################################
1658
##########################################################
1661
##		Fonction "cron"				##
1659
##		Fonction "cron"				##
1662
## - Mise en place des différents fichiers de cron	##
1660
## - Mise en place des différents fichiers de cron	##