Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (20 sloc) 0.606 kb
08c6397 @jvehent added useful shell scripts
authored
1 #! /bin/sh
2 URL=http://www.spamhaus.org/drop/drop.lasso
3 DROPLASSO=$(mktemp)
4 ACLFILE=$(mktemp)
5 POSTSCREEN_ACCESS_FILE=/etc/postfix/postscreen_access.cidr
6 DATE=$(date +%Y%m%d)
7
8 wget --quiet $URL -O $DROPLASSO
9
10 if [ -e $DROPLASSO ]
11 then
12 # decoupe le fichier source sur le point virgule
13 # et prepare le fichier de destination
14 for network in $(cat $DROPLASSO | awk '{print $1}' |\
15 grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]{1,2}$")
16 do
17 echo -e "$network\treject" >> $ACLFILE
18 done
19 fi
20
21 cp $POSTSCREEN_ACCESS_FILE{,.bkp$DATE}
22 cp $ACLFILE $POSTSCREEN_ACCESS_FILE
23 postfix reload
Something went wrong with that request. Please try again.