Subversion Repositories ALCASAR

Rev

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

Rev 1521 Rev 1529
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-conf.sh 1521 2014-12-17 22:57:44Z richard $
2
# $Id: alcasar-conf.sh 1529 2014-12-21 16:17:23Z richard $
3
 
3
 
4
# alcasar-conf.sh
4
# alcasar-conf.sh
5
# by REXY
5
# by REXY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 113... Line 113...
113
# The category "ip" no longer exist
113
# The category "ip" no longer exist
114
		$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist;	$SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
114
		$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist;	$SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
115
		$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
115
		$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
116
# BL and WL are now dynamically built in "/usr/local/share"
116
# BL and WL are now dynamically built in "/usr/local/share"
117
		rm -rf $DIR_UPDATE/etc/alcasar-dnsfilter-enabled $DIR_UPDATE/etc/alcasar-dnsfilter-available
117
		rm -rf $DIR_UPDATE/etc/alcasar-dnsfilter-enabled $DIR_UPDATE/etc/alcasar-dnsfilter-available
118
# Bing et Youtube are addes to the safesearching system
118
# Bing et Youtube are added to the safesearching system
119
		Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
119
		Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
120
		if [ $Bing -ne "1" ]; then
120
		if [ $Bing -ne "1" ]; then
121
			SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
121
			SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
122
			if [ $SafeSearch -eq "0" ]; then
122
			if [ $SafeSearch -eq "0" ]; then
123
			cat <<EOF >> $DIR_UPDATE/urlregexplist
123
			cat <<EOF >> $DIR_UPDATE/urlregexplist
Line 133... Line 133...
133
# Youtube - add 'edufilter=your_ID' 
133
# Youtube - add 'edufilter=your_ID' 
134
"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
134
"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
135
EOF
135
EOF
136
			fi
136
			fi
137
		fi
137
		fi
138
# la variable YOUTUBE_ID est déclarée dans le fichier de conf
138
# YOUTUBE_ID variable added in the conf file
139
	YOUTUBE_ID=`grep ^YOUTUBE_ID $CONF_FILE | cut -d"=" -f2`
139
	YOUTUBE_ID=`grep ^YOUTUBE_ID $CONF_FILE | cut -d"=" -f2`
140
	YOUTUBE_ID=${YOUTUBE_ID:="-1"}
140
	YOUTUBE_ID=${YOUTUBE_ID:="-1"}
141
	if [ $YOUTUBE_ID = "-1" ]; then
141
	if [ $YOUTUBE_ID = "-1" ]; then
142
		echo "YOUTUBE_ID=ABCD1234567890abcdef" >> $CONF_FILE
142
		echo "YOUTUBE_ID=ABCD1234567890abcdef" >> $CONF_FILE
143
	fi
143
	fi
144
# copie du fichier de config de dnsmasq
144
# DNSMASQ conf file
145
	 	cp /etc/sysconfig/dnsmasq $DIR_UPDATE
145
	 	cp /etc/sysconfig/dnsmasq $DIR_UPDATE
146
# copie du fichier de conf modifié
146
# ALCASAR conf file
147
	cp $CONF_FILE $DIR_UPDATE/etc/
147
	cp $CONF_FILE $DIR_UPDATE/etc/
148
# le répertoire "ISO" est remplacé par "system_backup" suite à la suppression de "mondoarchive" (V2.5)
-
 
149
		rm -rf /var/Save/ISO
-
 
150
# création de l'archive et copie dans le répertoire WEB associé
148
# création de l'archive et copie dans le répertoire WEB associé
151
		cd /tmp
149
		cd /tmp
152
		tar -cf alcasar-conf.tar conf/
150
		tar -cf alcasar-conf.tar conf/
153
		gzip -f alcasar-conf.tar
151
		gzip -f alcasar-conf.tar
154
		[ -d $DIR_SAVE ] && cp alcasar-conf.tar.gz $DIR_SAVE/$fichier
152
		[ -d $DIR_SAVE ] && cp alcasar-conf.tar.gz $DIR_SAVE/$fichier