#!/bin/sh
+#
+# This is file /etc/rc.d/init.d/privoxy and was put here
+# by the privoxy rpm
+#
+# chkconfig: 2345 84 09
+#
+# description: Web proxy with advanced filtering capabilities \
+# such as filtering web page content, managing \
+# cookies and removing ads
+#
+
# ********************************************************************
#
# File : $Source: /cvsroot/ijbswa/current/privoxy.init,v $
# privoxy.
#
# Copyright : Written by and Copyright (C) 2001 the SourceForge
-# PRIVOXY team. http://ijbswa.sourceforge.net
+# Privoxy team. http://www.privoxy.org/
#
# Based on the Internet Junkbuster originally written
# by and Copyright (C) 1997 Anonymous Coders and
#
# Revisions :
# $Log: privoxy.init,v $
+# Revision 1.8.2.3 2002/12/10 20:52:16 kick_
+# better service description. This text will be shown when the user configures the services
+#
+# Revision 1.8.2.2 2002/08/05 08:42:13 kick_
+# same permissions, same runlevels as all the other initscripts
+#
+# Revision 1.8.2.1 2002/07/12 09:14:26 kick_
+# don't use ghost files for rcX.d/*, chkconfig is available to do this job. Enable translation of error messge
+#
+# Revision 1.8 2002/04/09 02:51:31 hal9
+# Changed $JB to $PRIVOXY.
+#
+# Revision 1.7 2002/04/08 14:54:51 morcego
+# Moved the chkconfig comments to the begining of the file, couse Linuxconf
+# was getting confused with it where it was.
+#
+# Revision 1.6 2002/03/26 22:29:55 swa
+# we have a new homepage!
+#
+# Revision 1.5 2002/03/25 06:14:18 morcego
+# Removing the OPRG definition (no longer needed)
+#
# Revision 1.4 2002/03/25 04:16:48 hal9
# Fix proper config file location.
#
#
# ********************************************************************/
-# This is file /etc/rc.d/init.d/privoxy and was put here
-# by the privoxy rpm
-#
-# chkconfig: 235 84 09
-#
-# description: This shell script takes care of starting and stopping \
-# privoxy.
-#
-
# Source function library.
. /etc/rc.d/init.d/functions
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
-JB_PRG="privoxy"
-JB_BIN="/usr/sbin/$JB_PRG"
-JB_CONF="/etc/$JB_PRG/config"
-JB_USER="privoxy"
-JB_PID=/var/run/$JB_PRG.pid
-JB_LOCK=/var/lock/subsys/$JB_PRG
-JB="$JB_BIN --user $JB_USER.$JB_USER --pidfile $JB_PID $JB_CONF"
+PRIVOXY_PRG="privoxy"
+PRIVOXY_BIN="/usr/sbin/$PRIVOXY_PRG"
+PRIVOXY_CONF="/etc/$PRIVOXY_PRG/config"
+PRIVOXY_USER="privoxy"
+PRIVOXY_PID=/var/run/$PRIVOXY_PRG.pid
+PRIVOXY_LOCK=/var/lock/subsys/$PRIVOXY_PRG
+PRIVOXY="$PRIVOXY_BIN --user $PRIVOXY_USER.$PRIVOXY_USER --pidfile $PRIVOXY_PID $PRIVOXY_CONF"
# some checks for us
-! [ -x $JB_BIN ] && echo "Can't find $JB_BIN, exit." && exit 0
-! [ -f $JB_CONF ] && echo "Can't find $JB_CONF, exit." && exit 0
+! [ -x $PRIVOXY_BIN ] && echo $"Can't find $PRIVOXY_BIN, exit." && exit 0
+! [ -f $PRIVOXY_CONF ] && echo $"Can't find $PRIVOXY_CONF, exit." && exit 0
# See how we were called.
start () {
# start daemon
- echo -n $"Starting $JB_PRG: "
- if [ -f $JB_PID ]; then
- killproc $JB_PRG && rm -f $JB_LOCK $JB_PID
+ echo -n $"Starting $PRIVOXY_PRG: "
+ if [ -f $PRIVOXY_PID ]; then
+ killproc $PRIVOXY_PRG && rm -f $PRIVOXY_LOCK $PRIVOXY_PID
RETVAL=$?
[ $RETVAL != 0 ] && return $RETVAL
fi
- daemon $JB
+ daemon $PRIVOXY
RETVAL=$?
echo
- [ $RETVAL = 0 ] && touch $JB_LOCK
+ [ $RETVAL = 0 ] && touch $PRIVOXY_LOCK
return $RETVAL
}
stop () {
# stop daemon
- echo -n $"Stopping $JB_PRG: "
- killproc $JB_PRG && rm -f $JB_LOCK $JB_PID
+ echo -n $"Stopping $PRIVOXY_PRG: "
+ killproc $PRIVOXY_PRG && rm -f $PRIVOXY_LOCK $PRIVOXY_PID
RETVAL=$?
echo
return $RETVAL
stop
;;
reload)
- if [ -f $JB_PID ] ; then
- kill -HUP `cat $JB_PID`
+ if [ -f $PRIVOXY_PID ] ; then
+ kill -HUP `cat $PRIVOXY_PID`
RETVAL=$?
fi
;;
;;
condrestart)
# restart only if already running
- if [ -f $JB_PID ] ; then
+ if [ -f $PRIVOXY_PID ] ; then
stop
start
RETVAL=$?
fi
;;
status)
- status $JB_PRG
+ status $PRIVOXY_PRG
RETVAL=$?
;;
top)
- if [ -f $JB_PID ]; then
+ if [ -f $PRIVOXY_PID ]; then
a=""
- for i in `pidof $JB_PRG` ; do
+ for i in `pidof $PRIVOXY_PRG` ; do
a="$a -p $i"
done
top $a
fi
;;
*)
- echo $"Usage: $JB_PRG {start|stop|reload|restart|condrestart|status|top}"
+ echo $"Usage: $PRIVOXY_PRG {start|stop|reload|restart|condrestart|status|top}"
exit 1
esac