Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar.sh 654 2011-06-27 19:30:28Z richard $
|
2 |
# $Id: alcasar.sh 659 2011-06-29 21:23:56Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
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 277... |
Line 277... |
277 |
response=0
|
277 |
response=0
|
278 |
PTN='^[oOyYnN]$'
|
278 |
PTN='^[oOyYnN]$'
|
279 |
until [[ $(expr $response : $PTN) -gt 0 ]]
|
279 |
until [[ $(expr $response : $PTN) -gt 0 ]]
|
280 |
do
|
280 |
do
|
281 |
if [ $Lang == "fr" ]
|
281 |
if [ $Lang == "fr" ]
|
282 |
then echo -n "Voulez-vous utiliser cette addresse et ce plan d'adressage (recommandé) (O/n)? : "
|
282 |
then echo -n "Voulez-vous utiliser cette adresse et ce plan d'adressage (recommandé) (O/n)? : "
|
283 |
else echo -n "Do you want to use this IP address and this IP addressing plan (recommanded) (Y/n)? : "
|
283 |
else echo -n "Do you want to use this IP address and this IP addressing plan (recommanded) (Y/n)? : "
|
284 |
fi
|
284 |
fi
|
285 |
read response
|
285 |
read response
|
286 |
done
|
286 |
done
|
287 |
if [ "$response" = "n" ] || [ "$response" = "N" ]
|
287 |
if [ "$response" = "n" ] || [ "$response" = "N" ]
|
Line 896... |
Line 896... |
896 |
# on remplace la page d'interception (template)
|
896 |
# on remplace la page d'interception (template)
|
897 |
cp -f $DIR_CONF/template.html /usr/share/dansguardian/languages/ukenglish/
|
897 |
cp -f $DIR_CONF/template.html /usr/share/dansguardian/languages/ukenglish/
|
898 |
cp -f $DIR_CONF/template-fr.html /usr/share/dansguardian/languages/french/template.html
|
898 |
cp -f $DIR_CONF/template-fr.html /usr/share/dansguardian/languages/french/template.html
|
899 |
# on ne loggue que les deny (pour le reste, on a squid)
|
899 |
# on ne loggue que les deny (pour le reste, on a squid)
|
900 |
$SED "s?^loglevel =.*?loglevel = 1?g" $DIR_DG/dansguardian.conf
|
900 |
$SED "s?^loglevel =.*?loglevel = 1?g" $DIR_DG/dansguardian.conf
|
901 |
# lauch of 16 daemons
|
901 |
# lauch of 10 daemons (20 in largest server)
|
902 |
$SED "s?^minchildren =.*?minchildren = 16?g" $DIR_DG/dansguardian.conf
|
902 |
$SED "s?^minchildren =.*?minchildren = 10?g" $DIR_DG/dansguardian.conf
|
903 |
# on désactive par défaut le controle de contenu des pages html
|
903 |
# on désactive par défaut le controle de contenu des pages html
|
904 |
$SED "s?^weightedphrasemode =.*?weightedphrasemode = 0?g" $DIR_DG/dansguardian.conf
|
904 |
$SED "s?^weightedphrasemode =.*?weightedphrasemode = 0?g" $DIR_DG/dansguardian.conf
|
905 |
cp $DIR_DG/lists/bannedphraselist $DIR_DG/lists/bannedphraselist.default
|
905 |
cp $DIR_DG/lists/bannedphraselist $DIR_DG/lists/bannedphraselist.default
|
906 |
$SED "s?^[^#]?#&?g" $DIR_DG/lists/bannedphraselist # (on commente ce qui ne l'est pas)
|
906 |
$SED "s?^[^#]?#&?g" $DIR_DG/lists/bannedphraselist # (on commente ce qui ne l'est pas)
|
907 |
# on désactive par défaut le contrôle d'URL par expressions régulières
|
907 |
# on désactive par défaut le contrôle d'URL par expressions régulières
|
Line 948... |
Line 948... |
948 |
$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config # datas are send to squid (3128)
|
948 |
$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config # datas are send to squid (3128)
|
949 |
$SED "s?^# PORT.*?PORT 8090?g" /etc/havp/havp.config # datas come on 8090
|
949 |
$SED "s?^# PORT.*?PORT 8090?g" /etc/havp/havp.config # datas come on 8090
|
950 |
$SED "s?^# BIND_ADDRESS.*?BIND_ADDRESS 127.0.0.1?g" /etc/havp/havp.config # we listen only on loopback
|
950 |
$SED "s?^# BIND_ADDRESS.*?BIND_ADDRESS 127.0.0.1?g" /etc/havp/havp.config # we listen only on loopback
|
951 |
$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config # active libclamav AV
|
951 |
$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config # active libclamav AV
|
952 |
$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config # log only when malware matches
|
952 |
$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config # log only when malware matches
|
953 |
$SED "s?^# SERVERNUMBER.*?SERVERNUMBER 20?g" /etc/havp/havp.config # 20 daemons are started simultaneously
|
953 |
$SED "s?^# SERVERNUMBER.*?SERVERNUMBER 10?g" /etc/havp/havp.config # 10 daemons are started simultaneously
|
954 |
# remplacement du fichier d'initialisation
|
954 |
# remplacement du fichier d'initialisation
|
955 |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
|
955 |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
|
956 |
cp -f $DIR_CONF/havp-init /etc/init.d/havp
|
956 |
cp -f $DIR_CONF/havp-init /etc/init.d/havp
|
957 |
# on remplace la page d'interception (template)
|
957 |
# on remplace la page d'interception (template)
|
958 |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
|
958 |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
|