changeset 2:814f41175aed

Just set PATH, it's easier and works better with cron.
author darius@midget.dons.net.au
date Sun, 25 Nov 2007 10:50:36 +1030
parents b03231a4dcf0
children afe5276c03f2
files update-pg
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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