changeset 1:b03231a4dcf0

Add variables for locations of p7zip & tableutil.
author darius@midget.dons.net.au
date Sat, 24 Nov 2007 12:07:21 +1030
parents 58a9d49b4ae5
children 814f41175aed
files update-pg
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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