/alcasar.sh |
---|
714,8 → 714,8 |
# Add an empty radius database structure |
mysql -u$DB_USER -p$radiuspwd $DB_RADIUS < $DIR_CONF/radiusd-db-vierge.sql |
# modify the start script in order to close accounting connexion when the system is comming down or up |
[ -e /usr/lib/systemd/system/mysqld.service.default ] || cp /usr/lib/systemd/system/mysqld.service /usr/lib/systemd/system/mysqld.service.default |
$SED "/ExecStartPost=/a ExecStartPost=[ -e /usr/local/sbin/alcasar-mysql.sh ] && /usr/local/sbin/alcasar-mysql.sh -acct_stop" /usr/lib/systemd/system/mysqld.service |
[ -e /lib/systemd/system/mysqld.service.default ] || cp /lib/systemd/system/mysqld.service /lib/systemd/system/mysqld.service.default |
$SED "/ExecStartPost=/a ExecStartPost=[ -e /usr/local/sbin/alcasar-mysql.sh ] && /usr/local/sbin/alcasar-mysql.sh -acct_stop" /lib/systemd/system/mysqld.service |
$SED "/ExecStartPost=/a ExecStop=[ -e /usr/local/sbin/alcasar-mysql.sh ] && /usr/local/sbin/alcasar-mysql.sh -acct_stop" /usr/lib/systemd/system/mysqld.service |
systemctl daemon-reload |
} # End init_db () |
777,7 → 777,7 |
cp -f $DIR_CONF/radius/counter.conf /etc/raddb/sql/mysql/counter.conf |
chown -R radius:radius /etc/raddb/sql/mysql/* |
# insures that mysql is up before radius start |
$SED "s?^After=.*?After=syslog.target network.target mysqld.service?g" /usr/lib/systemd/system/radiusd.service |
[ -e $SED "s?^After=.*?After=syslog.target network.target mysqld.service?g" /lib/systemd/system/radiusd.service |
} # End param_radius () |
1039,7 → 1039,7 |
################################################################## |
## Fonction "antivirus" ## |
## - configuration havp + libclamav ## |
## - configuration of havp, libclamav and freshclam ## |
################################################################## |
antivirus () |
{ |
1071,17 → 1071,21 |
echo "*.youtube.com/*" >> /etc/havp/whitelist |
# remplacement du fichier d'initialisation |
[ -e /etc/init.d/havp.default ] || cp /etc/init.d/havp /etc/init.d/havp.default |
# if keep old init file : $SED "/$HAVP_BIN -c $HAVP_CONFIG/i chown -R havp:havp \/var\/tmp\/havp" /etc/init.d/havp |
# if keep old init file : |
cp -f $DIR_CONF/havp-init /etc/init.d/havp |
# on remplace la page d'interception (template) |
# replace the on remplace la page d'interception (template) |
cp -f $DIR_CONF/virus-fr.html /etc/havp/templates/fr/virus.html |
cp -f $DIR_CONF/virus-en.html /etc/havp/templates/en/virus.html |
# automatisation de la mise à jour de la base antivirale (toutes les 2 heures) |
$SED "s?^Checks.*?Checks 12?g" /etc/freshclam.conf |
# update virus database every 2 hours (24h/12) |
[ -e /etc/freshclam.conf.default ] || cp /etc/freshclam.conf /etc/freshclam.conf.default |
$SED "s?^Checks.*?Checks 6?g" /etc/freshclam.conf |
$SED "s?^NotifyClamd.*?# NotifyClamd /etc/clamd.conf?g" /etc/freshclam.conf |
$SED "/^DatabaseMirror/i DatabaseMirror db.fr.clamav.net" /etc/freshclam.conf |
$SED "/^DatabaseMirror/i DatabaseMirror switch.clamav.net" /etc/freshclam.conf |
# Copy of the main virus database |
rm -f /var/lib/clamav/*.cld # in case of old database scheme |
cp -f $DIR_CONF/clamav-main.cvd /var/lib/clamav/main.cvd |
/usr/bin/freshclam |
} |
################################################################################## |
1240,7 → 1244,7 |
server=$DNS2 |
EOF |
# 3rd dnsmasq listen on udp 55 ("dnsmasq with whitelis") |
cat << EOF > /etc/dnsmasq-blacklist.conf |
cat << EOF > /etc/dnsmasq-whitelist.conf |
# Configuration file for "dnsmasq with whitelist" |
# Inclusion de la whitelist <domains> de Toulouse dans la configuration |
conf-dir=$DIR_DEST_SHARE/dnsmasq-wl-enabled |
/scripts/alcasar-urpmi.sh |
---|
12,7 → 12,7 |
VERSION="4" |
ARCH="i586" |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ****** |
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mbstring php-sockets rng-utils dnsmasq rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd man gammu msec" |
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mbstring php-sockets rng-utils dnsmasq rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd man dkms-ipt_NETFLOW" |
rpm_repository_sync () |
{ |
67,11 → 67,11 |
then |
if [ $Lang == "fr" ] |
then |
echo "La migration automatique d'ALCASAR ne peut pas être réalisée." |
echo "Le système d'exploitation doit être remplacé" |
echo "L'installation ou la mise @ jour d'ALCASAR ne peut pas être réalisée." |
echo "Le système d'exploitation doit être remplacé (Mageia4)" |
else |
echo "The automatic update of ALCASAR can't be performed." |
echo "The OS must be replaced" |
echo "The OS must be replaced (Mageia4)" |
fi |
if [ -e /tmp/alcasar-conf.tar.gz ] |
then |
/scripts/sbin/alcasar-uninstall.sh |
---|
57,7 → 57,7 |
#init_db |
echo -en "\n- init_db(2) : " |
[ -e /etc/my.cnf.default ] && mv -f /etc/my.cnf.default /etc/my.cnf && echo -n "1, " |
[ -e /usr/lib/systemd/system/mysqld.service.default ] && mv -f /usr/lib/systemd/system/mysqld.service.default /usr/lib/systemd/system/mysqld.service && echo -n "2" |
[ -e /lib/systemd/system/mysqld.service.default ] && mv -f /lib/systemd/system/mysqld.service.default /lib/systemd/system/mysqld.service && echo -n "2" |
systemctl daemon-reload |
rm -rf /var/lib/mysql |
sleep 1 |
123,12 → 123,14 |
sleep 1 |
#antivirus |
echo -en "\n- antivirus(2) : " |
echo -en "\n- antivirus(4) : " |
if [ -e /etc/init.d/havp ] |
then |
[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "1, " |
userdel -r havp 2>/dev/null && echo -n "2" |
userdel -r havp 2>/dev/null && echo -n "2, " |
[ `grep havp /etc/fstab|wc -l` -ne "0" ] && $SED "/havp/d" /etc/fstab # anciennes versions (mémoire tampon sur disque) |
[ -e /etc/init.d/havp.default ] && mv /etc/init.d/havp.default /etc/init.d/havp && echo -n "3, " |
[ -e /etc/freshclam.conf.default ] && mv /etc/freshclam.conf.default /etc/freshclam.conf && echo -n "4" |
else echo -n "uninstalled" |
fi |
sleep 1 |
153,27 → 155,19 |
sleep 1 |
#DnsMasq |
echo -en "\n- dnsmasq(4) : " |
if [ -e /etc/init.d/dnsmasq ] |
echo -en "\n- dnsmasq(6) : " |
if [ -e /lib/systemd/system/dnsmasq.service ] |
then |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "1, " |
[ -e /etc/dnsmasq-blackhole.conf ] && rm -f /etc/dnsmasq-blackhole.conf && echo -n "2, " |
[ -d /etc/dnsmasq.d ] && rm -rf /etc/dnsmasq.d |
[ -e /etc/init.d/dnsmasq.default ] && mv /etc/init.d/dnsmasq.default /etc/init.d/dnsmasq && echo -n "3, " |
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "4" |
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "1 ," |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "2, " |
[ -e /etc/dnsmasq-blacklist.conf ] && rm /etc/dnsmasq-blacklist.conf && echo -n "3, " |
[ -e /etc/dnsmasq-whitelist.conf ] && rm /etc/dnsmasq-whitelist.conf && echo -n "4, " |
[ -e /lib/systemd/system/dnsmasq-blacklist.service ] && rm /lib/systemd/system/dnsmasq-blacklist.service && echo -n "5, " |
[ -e /lib/systemd/system/dnsmasq-whitelist.service ] && rm /lib/systemd/system/dnsmasq-whitelist.service && echo -n "6" |
else echo -n "uninstalled" |
fi |
sleep 1 |
#Bind |
echo -en "\n- bind(1) : " |
if [ -e /etc/init.d/named ] |
then |
/usr/sbin/urpme --auto bind --auto-orphans && echo -n "1" |
else echo -n "uninstalled" |
fi |
sleep 1 |
#dhcpd |
echo -en "\n- dhcp-server(1) : " |
if [ -e /etc/init.d/dhcpd ] |