2014-04-04 11:40:45 +00:00
|
|
|
#!/usr/bin/env watchman
|
|
|
|
|
|
|
|
privoxy_username='privoxy'
|
|
|
|
privoxy_configfile='/etc/privoxy/config'
|
|
|
|
|
2014-07-03 07:05:52 +00:00
|
|
|
service_respawn='true'
|
2014-04-04 11:40:45 +00:00
|
|
|
service_command='/usr/bin/privoxy'
|
2014-07-03 07:05:52 +00:00
|
|
|
service_args="--no-daemon --user ${privoxy_username} ${privoxy_configfile}"
|
2014-04-04 11:40:45 +00:00
|
|
|
|
|
|
|
privoxy::configtest() {
|
|
|
|
"${service_command}" --config-test ${service_args}
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
privoxy::configtest || {
|
|
|
|
watchman.err "Config test failed, not restarting!"
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
watchman.stop
|
|
|
|
watchman.start
|
|
|
|
}
|