File: wrapzap

package info (click to toggle)
adzapper 20080508-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 380 kB
  • ctags: 30
  • sloc: perl: 3,565; sh: 124; makefile: 48
file content (68 lines) | stat: -rwxr-xr-x 2,737 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/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_ADJSTEXT=
STUBURL_ADHTML=$ZAP_BASE/no-op.html
STUBURL_ADHTMLTEXT=
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_WEBBUGHTML=$ZAP_BASE/webbug.html

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_WEBBUGHTML \
	STUBURL_PRINT STUBURL_ADHTMLTEXT STUBURL_ADJSTEXT

# 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