summaryrefslogtreecommitdiff
path: root/adzap/scripts/update-zapper
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2006-12-02 17:57:56 +0000
committerdakkar <dakkar@luxion>2006-12-02 17:57:56 +0000
commit283a78c4ea345b9371f3a69f472375e5a4070a69 (patch)
tree10dfb9f60f1fc5716216558a9254dec41fb95130 /adzap/scripts/update-zapper
downloadmyProxy-283a78c4ea345b9371f3a69f472375e5a4070a69.tar.gz
myProxy-283a78c4ea345b9371f3a69f472375e5a4070a69.tar.bz2
myProxy-283a78c4ea345b9371f3a69f472375e5a4070a69.zip
import del proxy-filtro-salto-etc
git-svn-id: svn://luxion/repos/myProxy/trunk@229 fcb26f47-9200-0410-b104-b98ab5b095f3
Diffstat (limited to 'adzap/scripts/update-zapper')
-rwxr-xr-xadzap/scripts/update-zapper25
1 files changed, 25 insertions, 0 deletions
diff --git a/adzap/scripts/update-zapper b/adzap/scripts/update-zapper
new file mode 100755
index 0000000..4f32440
--- /dev/null
+++ b/adzap/scripts/update-zapper
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# UNTESTED sample script to update the zapper script from the master copy on
+# my web page. - Cameron Simpson <cs@zip.com.au> 21jun1999
+#
+# "wget" can be obtained from:
+# http://sunsite.auc.dk/wget/
+#
+
+masterurl=http://adzapper.sourceforge.net/scripts/squid_redirect
+zapper=./squid_redirect ## hack to suit your site
+pidfile=/var/run/squid-noads.pid ## hack to suit, again
+
+tmp=/tmp/newzapper$$
+if wget -q --cache=off -O $tmp "$masterurl"
+then
+ [ ! -s "$tmp" ] \
+ || cmp -s "$tmp" "$zapper" \
+ || ( cat "$tmp" >"$zapper" || exit 1
+ [ -s "$pidfile" ] && kill -1 `cat "$pidfile"`
+ )
+fi
+rm -f "$tmp"
+
+exit 0