39 lines
574 B
Bash
39 lines
574 B
Bash
#!/bin/sh
|
|
#
|
|
# /etc/rc.d/rc.privoxy
|
|
#
|
|
# Start/stop/restart the privoxy server.
|
|
#
|
|
|
|
prvy_pid="/var/run/privoxy.pid"
|
|
prvy_user="nobody"
|
|
prvy_config="/etc/privoxy/config"
|
|
|
|
prvy_start() {
|
|
echo "Starting Privoxy"
|
|
/bin/privoxy --no-daemon --pidfile $prvy_pid --user $prvy_user $prvy_config > /dev/null 2>&1 &
|
|
}
|
|
|
|
prvy_stop() {
|
|
killall privoxy
|
|
}
|
|
|
|
prvy_restart() {
|
|
prvy_stop
|
|
sleep 2
|
|
prvy_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
prvy_start
|
|
;;
|
|
'stop')
|
|
prvy_stop
|
|
;;
|
|
'restart')
|
|
prvy_restart
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
esac
|