Subversion Repositories ALCASAR

Rev

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

Rev 1056 Rev 1377
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-havp.sh 1056 2013-03-26 21:46:36Z stephane $
2
# $Id: alcasar-havp.sh 1377 2014-06-10 22:16:50Z richard $
3
 
3
 
4
# alcasar-havp.sh
4
# alcasar-havp.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 12... Line 12...
12
SED="/bin/sed -i"
12
SED="/bin/sed -i"
13
function av_disable (){
13
function av_disable (){
14
	$SED "s/^cache_peer.*/#cache_peer 127\.0\.0\.1 parent 8090 0 no-query default/g" /etc/squid/squid.conf
14
	$SED "s/^cache_peer.*/#cache_peer 127\.0\.0\.1 parent 8090 0 no-query default/g" /etc/squid/squid.conf
15
	$SED "s/^never_direct.*/#never_direct allow all/g" /etc/squid/squid.conf
15
	$SED "s/^never_direct.*/#never_direct allow all/g" /etc/squid/squid.conf
16
	$SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=off/g" /usr/local/etc/alcasar.conf
16
	$SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=off/g" /usr/local/etc/alcasar.conf
17
	service squid reload
-
 
18
	service havp stop
17
	service havp stop
19
}
18
}
20
function av_enable (){
19
function av_enable (){
21
	$SED "s/^#cache_peer.*/cache_peer 127\.0\.0\.1 parent 8090 0 no-query default/g" /etc/squid/squid.conf
20
	$SED "s/^#cache_peer.*/cache_peer 127\.0\.0\.1 parent 8090 0 no-query default/g" /etc/squid/squid.conf
22
	$SED "s/^#never_direct.*/never_direct allow all/g" /etc/squid/squid.conf
21
	$SED "s/^#never_direct.*/never_direct allow all/g" /etc/squid/squid.conf
23
	$SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=on/g" /usr/local/etc/alcasar.conf
22
	$SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=on/g" /usr/local/etc/alcasar.conf
24
	service squid reload
-
 
25
	service havp start
23
	service havp start
26
}
24
}
27
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}"
25
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}"
28
nb_args=$#
26
nb_args=$#
29
args=$1
27
args=$1