summaryrefslogtreecommitdiff
path: root/adzap/scripts/wrapzap
diff options
context:
space:
mode:
Diffstat (limited to 'adzap/scripts/wrapzap')
-rwxr-xr-xadzap/scripts/wrapzap65
1 files changed, 65 insertions, 0 deletions
diff --git a/adzap/scripts/wrapzap b/adzap/scripts/wrapzap
new file mode 100755
index 0000000..e1e43ac
--- /dev/null
+++ b/adzap/scripts/wrapzap
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# Wrapper to set environment variables then exec the real zapper.
+# The reasons for this are twofold:
+# - for some reason squid doesn't preserve the original environment
+# when you do a restart (or SIGHUP)
+# - to avoid having to hack the squid startup script (if you have
+# a presupplied one, such as ships with some linux distributions)
+#
+# Install in the same directory you put the zapper (just for convenience) and
+# hack the pathnames below to suit.
+# Note that you can skip this script and run the zapper with no environment
+# settings at all and it will work fine; the variables are all set here merely
+# for completeness so that customisation is easy for you.
+# - Cameron Simpson <cs@zip.com.au> 21apr2000
+#
+
+# modify this to match your install
+zapper=/usr/local/bin/squid_redirect
+
+ZAP_MODE= # or "CLEAR"
+ZAP_BASE=http://adzapper.sourceforge.net/zaps # a local web server will be better
+ZAP_BASE_SSL=https://adzapper.sourceforge.net/zaps # this can probably be ignored
+
+ZAP_PREMATCH= # pathname of extra pattern file
+ # for patterns to preempt the stock
+ # zapper
+ZAP_POSTMATCH= # pathname of extra pattern file
+ # for patterns in addition to the
+ # stock zapper; this is the one to
+ # which you should add new ads
+ZAP_MATCH= # pathname of extra pattern file
+ # for patterns to use instead of the
+ # inbuilt pattern list
+ZAP_NO_CHANGE= # set to "NULL" is your proxy is Apache2 instead of Squid
+
+STUBURL_AD=$ZAP_BASE/ad.gif
+STUBURL_ADSSL=$ZAP_BASE_SSL/ad.gif
+STUBURL_ADBG=$ZAP_BASE/adbg.gif
+STUBURL_ADJS=$ZAP_BASE/no-op.js
+STUBURL_ADHTML=$ZAP_BASE/no-op.html
+STUBURL_ADMP3=$ZAP_BASE/ad.mp3
+STUBURL_ADPOPUP=$ZAP_BASE/closepopup.html
+STUBURL_ADSWF=$ZAP_BASE/ad.swf
+STUBURL_COUNTER=$ZAP_BASE/counter.gif
+STUBURL_COUNTERJS=$ZAP_BASE/no-op-counter.js
+STUBURL_COUNTERHTML=$ZAP_BASE/no-op-counter.html
+STUBURL_WEBBUG=$ZAP_BASE/webbug.gif
+STUBURL_WEBBUGJS=$ZAP_BASE/webbug.js
+
+STUBURL_PRINT= # off by default, set to 1
+
+export ZAP_MODE ZAP_BASE ZAP_BASE_SSL ZAP_PREMATCH ZAP_POSTMATCH ZAP_MATCH ZAP_NO_CHANGE
+export STUBURL_AD STUBURL_ADSSL STUBURL_ADJS STUBURL_ADHTML STUBURL_ADMP3 \
+ STUBURL_ADPOPUP STUBURL_ADSWF STUBURL_COUNTER STUBURL_COUNTERJS \
+ STUBURL_COUNTERHTML STUBURL_WEBBUG STUBURL_WEBBUGJS \
+ STUBURL_PRINT
+
+# Here, having arranged the environment, we exec the real zapper.
+# If you're chaining redirectors then comment out the direct exec below and
+# uncomment (and adjust) the exec of zapchain which takes care of running
+# multiple redirections.
+
+exec "$zapper"
+# exec /path/to/zapchain "$zapper" /path/to/another/eg/squirm