diff options
author | Andrew Lewman <andrew@torproject.org> | 2007-09-23 01:16:28 +0000 |
---|---|---|
committer | Andrew Lewman <andrew@torproject.org> | 2007-09-23 01:16:28 +0000 |
commit | 2aa0cfd5eeeb67953fd861a5f60aeb374b7785a7 (patch) | |
tree | a31eaf84f4ba375208d310366e8542a85dbb6835 /contrib/polipo/Polipo | |
parent | 011941853cc7f7211b1d57b0b43b6bbbfb013ad1 (diff) | |
download | tor-2aa0cfd5eeeb67953fd861a5f60aeb374b7785a7.tar tor-2aa0cfd5eeeb67953fd861a5f60aeb374b7785a7.tar.gz |
Add my polipo hacks to the tor repo to keep track of them.
svn:r11587
Diffstat (limited to 'contrib/polipo/Polipo')
-rw-r--r-- | contrib/polipo/Polipo | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/polipo/Polipo b/contrib/polipo/Polipo new file mode 100644 index 000000000..14589c84d --- /dev/null +++ b/contrib/polipo/Polipo @@ -0,0 +1,40 @@ +#!/bin/sh + +## +# Polipo +## + +. /etc/rc.common + +StartService () +{ + if [ -f /Library/Polipo/bin/polipo ]; then + if pid=$(GetPID polipo); then + return 0 + else if [ "${POLIPO:=-NO-}" = "-YES-" ]; then + ConsoleMessage "Starting Polipo" + /Library/Polipo/bin/polipo -c /Library/Polipo/www/config + fi + fi + fi +} + +StopService () +{ + if pid=$(GetPID polipo); then + ConsoleMessage "Stopping Polipo" + kill -TERM "${pid}" + else + ConsoleMessage "Polipo not responding." +# Just for sanity (sometimes necessary.) + killall tor 2>/dev/null + fi +} + +RestartService () +{ + StopService + StartService +} + +RunService "$1" |