mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 23:33:31 +01:00
41 lines
668 B
Plaintext
41 lines
668 B
Plaintext
|
#!/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"
|