2 # ********************************************************************
6 PRIVOXY_PRG="%PROGRAM%"
7 PRIVOXY_BIN="%SBIN_DEST%/$PRIVOXY_PRG"
8 PRIVOXY_CONF="%CONF_DEST%/config"
10 PRIVOXY_GROUP="%GROUP%"
11 PRIVOXY_PID="/var/run/$PRIVOXY_PRG"/$PRIVOXY_PRG.pid
14 check=(`/bin/ps -e|/bin/grep $PRIVOXY_PRG|/usr/bin/wc -l`)
17 if [ ! -x $PRIVOXY_BIN ] ; then exit 0 ;fi
18 if [ ! -f $PRIVOXY_CONF ] ; then exit 0 ;fi
20 # See how we were called.
22 PRIVOXY="$PRIVOXY_BIN $PRIVOXY_CONF"
26 echo -n $"Starting $PRIVOXY_PRG: "
28 if [ ! -f $PRIVOXY_PID ]; then
29 ($PRIVOXY --user $PRIVOXY_USER.$PRIVOXY_GROUP --pidfile $PRIVOXY_PID 2>/dev/tty9 ) \
31 && /bin/touch /var/lock/$PRIVOXY_PRG \
33 elif [ $check -lt 3 ]; then
34 echo "Zombie lock file found"
35 /bin/rm -f /var/lock/$PRIVOXY_PRG $PRIVOXY_PID
39 echo "Already running"
46 echo -n $"Stopping $PRIVOXY_PRG: "
47 if [ -f $PRIVOXY_PID ]; then
48 /bin/kill `/bin/cat $PRIVOXY_PID` \
49 && /bin/rm -f /var/lock/$PRIVOXY_PRG $PRIVOXY_PID \
66 if [ -f $PRIVOXY_PID ] ; then
67 /bin/kill -HUP `cat $PRIVOXY_PID` \
76 echo "Kill all Privoxy"
77 /bin/rm -f /var/lock/$PRIVOXY_PRG $PRIVOXY_PID
81 # restart only if already running
82 if [ -f $PRIVOXY_PID ] ; then
88 /bin/ps ax|/bin/grep $PRIVOXY_PRG|/bin/grep -v 'grep\|init\.d\|rc\.d'
92 if [ -f $PRIVOXY_PID ]; then
94 for i in `/sbin/pidof $PRIVOXY_PRG` ; do
101 echo $"Usage: $PRIVOXY_PRG {start|stop|reload|restart|condrestart|status|top|kill}"