# HG changeset patch # User darius@midget.dons.net.au # Date 1195868241 -37800 # Node ID b03231a4dcf0904e2e74e145c75837e0103c5d96 # Parent 58a9d49b4ae5d75e202aa275119e661777b036df Add variables for locations of p7zip & tableutil. diff -r 58a9d49b4ae5 -r b03231a4dcf0 update-pg --- a/update-pg Fri Nov 23 10:11:27 2007 +1030 +++ b/update-pg Sat Nov 24 12:07:21 2007 +1030 @@ -8,6 +8,8 @@ URL=http://peerguardian.sourceforge.net/lists/p2p.php BASE=/var/db/peerguardian IPSATONCE=10000 +P7ZIP=/usr/local/bin/p7zip +TABLEUTIL=/usr/local/bin/tableutil if [ ! -w $BASE ]; then echo "Can't write to $BASE, giving up" >&2 @@ -28,7 +30,7 @@ exit 0 fi -p7zip -d <$BASE/p2p.php | sed "s/.*:\([0-9.-]\)/\1/" | tableutil -c '$whitelist = {203.31.81.0/24, 144.110.0.0/16}; $blacklist = load(text, "/dev/stdin"); $wlinv = invert($whitelist); $blocklist = intersect($wlinv, $blacklist); save(cidr, "/dev/stdout", $blocklist);' >$BASE/p2p-blocklist.txt +$P7ZIP -d <$BASE/p2p.php | sed "s/.*:\([0-9.-]\)/\1/" | $TABLEUTIL -c '$whitelist = {203.31.81.0/24, 144.110.0.0/16}; $blacklist = load(text, "/dev/stdin"); $wlinv = invert($whitelist); $blocklist = intersect($wlinv, $blacklist); save(cidr, "/dev/stdout", $blocklist);' >$BASE/p2p-blocklist.txt if [ $? -ne 0 ]; then echo "Couldn't unpack or process blocklist" rm -f $BASE/p2p-blocklist.txt