# HG changeset patch # User darius@midget.dons.net.au # Date 1195950036 -37800 # Node ID 814f41175aed7c6e18477db6e65efc265a3f8575 # Parent b03231a4dcf0904e2e74e145c75837e0103c5d96 Just set PATH, it's easier and works better with cron. diff -r b03231a4dcf0 -r 814f41175aed update-pg --- a/update-pg Sat Nov 24 12:07:21 2007 +1030 +++ b/update-pg Sun Nov 25 10:50:36 2007 +1030 @@ -4,12 +4,12 @@ # Update the peer guardian table in pf # +export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin + TABLE=peerguardian 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 @@ -30,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