Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar.sh 479 2011-02-08 22:51:17Z richard $
|
2 |
# $Id: alcasar.sh 481 2011-02-08 23:24:15Z franck $
|
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 928... |
Line 928... |
928 |
groupadd -f havp
|
928 |
groupadd -f havp
|
929 |
useradd -M -g havp havp
|
929 |
useradd -M -g havp havp
|
930 |
# création de la zone de travail temporaire (50Mo) en mémoire
|
930 |
# création de la zone de travail temporaire (50Mo) en mémoire
|
931 |
mkdir -p /var/tmp/havp /var/log/havp
|
931 |
mkdir -p /var/tmp/havp /var/log/havp
|
932 |
chown -R havp /var/tmp/havp /var/log/havp /var/run/havp
|
932 |
chown -R havp /var/tmp/havp /var/log/havp /var/run/havp
|
933 |
echo "# Entry for havp tmp files scan partition" >> /etc/fstab
|
933 |
# echo "# Entry for havp tmp files scan partition" >> /etc/fstab
|
934 |
echo "tmpfs /var/tmp/havp tmpfs mand,noatime,size=50m,nosuid,noexec 0 0" >> /etc/fstab
|
934 |
# echo "tmpfs /var/tmp/havp tmpfs mand,noatime,size=50m,nosuid,noexec 0 0" >> /etc/fstab
|
935 |
$SED "/$HAVP_BIN -c $HAVP_CONFIG/i chown -R havp:havp \/var\/tmp\/havp" /etc/init.d/havp
|
935 |
$SED "/$HAVP_BIN -c $HAVP_CONFIG/i chown -R havp:havp \/var\/tmp\/havp" /etc/init.d/havp
|
936 |
# configuration d'HAVP
|
936 |
# configuration d'HAVP
|
937 |
[ -e /etc/havp/havp.config.default ] || cp /etc/havp/havp.config /etc/havp/havp.config.default
|
937 |
[ -e /etc/havp/havp.config.default ] || cp /etc/havp/havp.config /etc/havp/havp.config.default
|
938 |
$SED "/^REMOVETHISLINE/d" /etc/havp/havp.config
|
938 |
$SED "/^REMOVETHISLINE/d" /etc/havp/havp.config
|
939 |
$SED "s?^# PARENTPROXY.*?PARENTPROXY 127.0.0.1?g" /etc/havp/havp.config
|
939 |
$SED "s?^# PARENTPROXY.*?PARENTPROXY 127.0.0.1?g" /etc/havp/havp.config
|
940 |
$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config
|
940 |
$SED "s?^# PARENTPORT.*?PARENTPORT 3128?g" /etc/havp/havp.config
|
941 |
$SED "s?^# PORT.*?PORT 8090?g" /etc/havp/havp.config
|
941 |
$SED "s?^# PORT.*?PORT 8090?g" /etc/havp/havp.config
|
942 |
$SED "s?^# BIND_ADDRESS.*?BIND_ADDRESS 127.0.0.1?g" /etc/havp/havp.config
|
942 |
$SED "s?^# BIND_ADDRESS.*?BIND_ADDRESS 127.0.0.1?g" /etc/havp/havp.config
|
943 |
$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config
|
943 |
$SED "s?^ENABLECLAMLIB.*?ENABLECLAMLIB true?g" /etc/havp/havp.config
|
944 |
$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config
|
944 |
$SED "s?^# LOG_OKS.*?LOG_OKS false?g" /etc/havp/havp.config
|
945 |
# modification du fichier d'initialisation
|
945 |
# remplacement du fichier d'initialisation
|
946 |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
|
946 |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default
|
- |
|
947 |
cp -f $DIR_CONF/havp-init /etc/init.d/havp
|
947 |
# ajout de la fonction 'status' (utile pour la gestion du process)
|
948 |
# ajout de la fonction 'status' (utile pour la gestion du process)
|
948 |
$SED "/^HAVP_BIN=/i. /etc/init.d/functions" /etc/init.d/havp
|
949 |
# $SED "/^HAVP_BIN=/i. /etc/init.d/functions" /etc/init.d/havp
|
949 |
$SED "s?^[\t ]*echo \"Checking for.*?status havp?g" /etc/init.d/havp
|
950 |
# $SED "s?^[\t ]*echo \"Checking for.*?status havp?g" /etc/init.d/havp
|
950 |
# on remplace la page d'interception (template)
|
951 |
# on remplace la page d'interception (template)
|
951 |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
|
952 |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html
|
952 |
cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
|
953 |
cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html
|
953 |
}
|
954 |
}
|
954 |
|
955 |
|