/scripts/alcasar-urpmi.sh |
---|
145,7 → 145,7 |
else |
echo "Nettoyage du système : " |
fi |
for rm_rpm in shorewall mandi radeontool avahi |
for rm_rpm in shorewall mandi radeontool avahi awstats |
do |
/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null |
echo -n "." |
/scripts/sbin/alcasar-uninstall.sh |
---|
139,7 → 139,11 |
#awstats |
echo -en "\n- awstats(1) : " |
[ -e /etc/awstats/awstats.conf.default ] && mv /etc/awstats/awstats.conf.default /etc/awstats/awstats.conf && echo -n "1" |
if [ -e /etc/awstats/awstats.conf.default ] |
then |
mv /etc/awstats/awstats.conf.default /etc/awstats/awstats.conf && echo -n "1" |
else echo -n "uninstalled" |
sleep 1 |
#DnsMasq |
/scripts/alcasar-archive.sh |
---|
58,12 → 58,25 |
function archive() { |
mkdir -p $DIR_ARCHIVE |
mkdir -p $DIR_TMP |
nb_files=`ls $DIR_LOG/firewall/tracability.log*.gz 2>/dev/null | wc -w` |
if [ $nb_files -ne 0 ]; then |
mv $(echo $(ls -rt $DIR_LOG/firewall/tracability.log*.gz | tail -n 1 -)) $DIR_TMP/tracability-HTTP.log-$NOW.gz |
fi |
nb_files=`ls $DIR_BASE/radius-*.sql 2>/dev/null | wc -w` |
if [ $nb_files -ne 0 ]; then |
mv $(echo $(ls -rt $DIR_BASE/radius-*.sql | tail -n 1 -)) $DIR_TMP/ |
fi |
cd /var/log/nfsen/profiles-data/live/ipt_netflow |
nb_files=`find . -mtime -7 -name 'nfcapd.[0-9]*' | wc -l` |
if [ $nb_files -ne 0 ]; then |
find . -mtime -7 -name 'nfcapd.[0-9]*' | xargs tar -cf $DIR_TMP/tracability-ALL.log-$NOW.tar; |
fi |
cd /tmp/ |
nb_files=`ls archive-$NOW/* 2>/dev/null | wc -w` |
if [ $nb_files -ne 0 ]; then |
tar cvzf /tmp/$FILE archive-$NOW/* |
else echo "no file to archive" |
fi |
} # end archive |
# Core script |
78,6 → 91,7 |
--now | -n) |
cleanup |
archive |
if [ -e /tmp/$FILE ]; then |
if [ $CRYPT -eq "1" ]; then |
{ |
# 1 ) chiffrement/signature =1 ==> gpg --encrypt avec test de la clé présente |
95,6 → 109,7 |
cp /tmp/$FILE $DIR_ARCHIVE/. |
} |
fi |
fi |
rm -rf /tmp/archive-* |
chown root:apache $DIR_ARCHIVE/* |
;; |
/alcasar.sh |
---|
42,9 → 42,9 |
# param_nfsen : Configuration du grapheur nfsen pour apache |
# dnsmasq : Name server configuration |
# BL : BlackList of Toulouse configuration : split into 3 BL (for Dnsmasq, for dansguardian and for Netfilter) |
# cron : Mise en place des exports de logs (+ chiffrement) |
# cron : Logs export + watchdog + connexion statistics |
# fail2ban : Fail2ban installation and configuration |
# post_install : Finalisation environnement ( sécurité, bannières, rotation logs, ...) |
# post_install : Security, log rotation, etc. |
DATE=`date '+%d %B %Y - %Hh%M'` |
DATE_SHORT=`date '+%d/%m/%Y'` |
1647,8 → 1647,7 |
# Load and apply the previous conf file |
if [ "$mode" = "update" ] |
then |
# export des logs en 'retard' dans /var/Save/logs |
/usr/local/bin/alcasar-archive.sh --now |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/logs |
$DIR_DEST_BIN/alcasar-conf.sh --load |
PARENT_SCRIPT=`basename $0` |
export PARENT_SCRIPT # to avoid stop&start process during the installation process |