Subversion Repositories ALCASAR

Rev

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

Rev 879 Rev 885
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-conf.sh 879 2012-06-03 20:50:48Z richard $
2
# $Id: alcasar-conf.sh 885 2012-06-11 21:33:50Z 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 173... Line 173...
173
# DHCP mode can be "off/half/full" since V2.6
173
# DHCP mode can be "off/half/full" since V2.6
174
		DHCP_mode=`cat $CONF_FILE|grep DHCP=|cut -d"=" -f2`
174
		DHCP_mode=`cat $CONF_FILE|grep DHCP=|cut -d"=" -f2`
175
		if [ $DHCP_mode = "on" ]; then
175
		if [ $DHCP_mode = "on" ]; then
176
			$SED "s?^DHCP=on.*?DHCP=half?" $CONF_FILE	# DHCP option can be "off/half/full" since V2.6
176
			$SED "s?^DHCP=on.*?DHCP=half?" $CONF_FILE	# DHCP option can be "off/half/full" since V2.6
177
		fi
177
		fi
178
		cp $CONF_FILE $DIR_UPDATE/etc/
-
 
179
# le paramêtre 'EXT_LAN_FILTERING' n'existe plus depuis la V2.6
178
# le paramêtre 'EXT_LAN_FILTERING' n'existe plus depuis la V2.6
180
		$SED "/^EXT_LAN/d" $DIR_UPDATE/etc/alcasar.conf
179
		$SED "/^EXT_LAN/d" $CONF_FILE
181
# la catégorie de sites filtrés "ip" n'existe plus depuis la V2.6
180
# la catégorie de sites filtrés "ip" n'existe plus depuis la V2.6
182
		$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist;	$SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
181
		$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist;	$SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
183
		$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/alcasar-bl-categories-enabled
182
		$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
-
 
183
# bing et Youtube sont ajoutés au safesearching depuis la V2.6
-
 
184
		Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
-
 
185
		if [ $Bing -ne "1" ]; then
-
 
186
			SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
-
 
187
			if [ $SafeSearch -eq "0" ]; then
-
 
188
			cat <<EOF >> $DIR_UPDATE/urlregexplist
-
 
189
# Bing - add 'adlt=strict'
-
 
190
#"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
-
 
191
# Youtube - add 'edufilter=your_ID' 
-
 
192
#"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
-
 
193
EOF
-
 
194
			else
-
 
195
			cat <<EOF >> $DIR_UPDATE/urlregexplist
-
 
196
# Bing - add 'adlt=strict'
-
 
197
"(^http://[0-9a-z]+\.bing\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&adlt=strict"
-
 
198
# Youtube - add 'edufilter=your_ID' 
-
 
199
"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
-
 
200
EOF
-
 
201
			fi
-
 
202
		fi
-
 
203
# la variable YOUTUBE_ID est déclarée dans le fichier de conf depuis la V2.6
-
 
204
	YOUTUBE_ID=`grep ^YOUTUBE_ID $CONF_FILE | cut -d"=" -f2`
-
 
205
	YOUTUBE_ID=${YOUTUBE_ID:="-1"}
-
 
206
	if [ $YOUTUBE_ID = "-1" ]; then
-
 
207
		echo "YOUTUBE_ID=ABCD1234567890abcdef" >> $CONF_FILE
-
 
208
	fi
-
 
209
# copie du fichier de conf modifié
-
 
210
	cp $CONF_FILE $DIR_UPDATE/etc/
184
# le répertoire "ISO" est remplacé par "system_backup" suite à la suppression de "mondoarchive" (V2.5)
211
# le répertoire "ISO" est remplacé par "system_backup" suite à la suppression de "mondoarchive" (V2.5)
185
		rm -rf /var/Save/ISO
212
		rm -rf /var/Save/ISO
186
# création de l'archive et copie dans le répertoire WEB associé
213
# création de l'archive et copie dans le répertoire WEB associé
187
		cd /tmp
214
		cd /tmp
188
		tar -cf alcasar-conf.tar conf/
215
		tar -cf alcasar-conf.tar conf/