[firewall_new,firewall,firewall-logrotate-script] On laisse acceuil et isolement sur squid, on met les blacklist softs vers squid, le reste passe en direct.

Ignore-this: a6e2c0a26fddbb7232360f64dc3cfec5

darcs-hash:20111118161604-3a55a-c88c1122b35bc897010fbf03d431d58175a3f1ac.gz
This commit is contained in:
Valentin Samir 2011-11-18 17:16:04 +01:00
parent a27e3da685
commit 587860cd5d
3 changed files with 82 additions and 46 deletions

View file

@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/bash
umask 0177
@ -18,8 +18,14 @@ fi
while ( ls -tr "$logs_src" | grep -E 'logall\.log\.[0-9]+\..z2?' ); do
dernier_fichier=$logs_src/$(ls -tr "$logs_src" | grep -E 'logall\.log\.[0-9]+\..z2?' | head -1)
timestamp=$(bzcat "$dernier_fichier" | head -1 | awk '{print $1}')
date=$(date -d "1970-01-01 $timestamp sec" +"%Y-%m-%d")
#timestamp=$(bzcat "$dernier_fichier" | head -1 | awk '{print $1}')
#date=$(date -d "1970-01-01 $timestamp sec" +"%Y-%m-%d")
Y=$(date | awk '{print $4}')
Y=${Y:0:4}
M=$(sudo bzcat "$dernier_fichier" | head -1 | awk '{print $1}')
M=$(date -d "01-$M-01" +%m)
D=$(sudo bzcat "$dernier_fichier" | head -1 | awk '{print $2}')
date=$Y-$M-$D
echo install -o root -g root -m 400 "$dernier_fichier" "$logs_dst/logall.log.$date.bz2"
echo rm "$dernier_fichier"
install -o root -g root -m 400 "$dernier_fichier" "$logs_dst/logall.log.$date.bz2"