smlinux/net/privoxy/rc.privoxy
2022-02-13 15:56:03 +05:30

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