3 # This is file /etc/rc.d/init.d/privoxy and was put here
6 # chkconfig: 2345 84 09
8 # description: Web proxy with advanced filtering capabilities \
9 # such as filtering web page content, managing \
10 # cookies and removing ads
13 # ********************************************************************
15 # File : $Source: /cvsroot/ijbswa/current/privoxy.init,v $
17 # Purpose : This shell script takes care of starting and stopping
20 # Copyright : Written by and Copyright (C) 2001 the SourceForge
21 # Privoxy team. http://www.privoxy.org/
23 # Based on the Internet Junkbuster originally written
24 # by and Copyright (C) 1997 Anonymous Coders and
25 # Junkbusters Corporation. http://www.junkbusters.com
27 # This program is free software; you can redistribute it
28 # and/or modify it under the terms of the GNU General
29 # Public License as published by the Free Software
30 # Foundation; either version 2 of the License, or (at
31 # your option) any later version.
33 # This program is distributed in the hope that it will
34 # be useful, but WITHOUT ANY WARRANTY; without even the
35 # implied warranty of MERCHANTABILITY or FITNESS FOR A
36 # PARTICULAR PURPOSE. See the GNU General Public
37 # License for more details.
39 # The GNU General Public License should be included with
40 # this file. If not, you can view it at
41 # http://www.gnu.org/copyleft/gpl.html
42 # or write to the Free Software Foundation, Inc., 59
43 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
45 # ********************************************************************/
48 # Source function library.
49 . /etc/rc.d/init.d/functions
51 . /etc/sysconfig/network
53 # Check that networking is up.
54 [ ${NETWORKING} = "no" ] && exit 0
57 PRIVOXY_BIN="/usr/sbin/$PRIVOXY_PRG"
58 PRIVOXY_CONF="/etc/$PRIVOXY_PRG/config"
59 PRIVOXY_USER="privoxy"
60 PRIVOXY_PID=/var/run/$PRIVOXY_PRG.pid
61 PRIVOXY_LOCK=/var/lock/subsys/$PRIVOXY_PRG
62 PRIVOXY="$PRIVOXY_BIN --user $PRIVOXY_USER.$PRIVOXY_USER --pidfile $PRIVOXY_PID $PRIVOXY_CONF"
65 ! [ -x $PRIVOXY_BIN ] && echo $"Can't find $PRIVOXY_BIN, exit." && exit 0
66 ! [ -f $PRIVOXY_CONF ] && echo $"Can't find $PRIVOXY_CONF, exit." && exit 0
68 # See how we were called.
72 echo -n $"Starting $PRIVOXY_PRG: "
73 if [ -f $PRIVOXY_PID ]; then
74 killproc $PRIVOXY_PRG && rm -f $PRIVOXY_LOCK $PRIVOXY_PID
76 [ $RETVAL != 0 ] && return $RETVAL
81 [ $RETVAL = 0 ] && touch $PRIVOXY_LOCK
87 echo -n $"Stopping $PRIVOXY_PRG: "
88 killproc $PRIVOXY_PRG && rm -f $PRIVOXY_LOCK $PRIVOXY_PID
102 if [ -f $PRIVOXY_PID ] ; then
103 kill -HUP `cat $PRIVOXY_PID`
113 # restart only if already running
114 if [ -f $PRIVOXY_PID ] ; then
125 if [ -f $PRIVOXY_PID ]; then
127 for i in `pidof $PRIVOXY_PRG` ; do
134 echo $"Usage: $PRIVOXY_PRG {start|stop|reload|restart|condrestart|status|top}"