File: update-zapper

package info (click to toggle)
adzapper 20050316-1sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 356 kB
  • ctags: 31
  • sloc: perl: 3,182; sh: 105; makefile: 48
file content (25 lines) | stat: -rwxr-xr-x 630 bytes parent folder | download | duplicates (5)
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
#!/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=/usr/bin/adzapper		## hack to suit your site
pidfile=/var/run/squid.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