X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=privoxy.init;h=aa0577bc53c69e2eccb7dbe09aa6ff21cf385d2c;hp=02769f55ce4c985e67ef68e66a780b5c0a2371f2;hb=114c72fda4a6df07cd8a067a8fbafacaa3730c71;hpb=c39030e5381369a9cabd2ee15ef34926f11697de diff --git a/privoxy.init b/privoxy.init index 02769f55..aa0577bc 100644 --- a/privoxy.init +++ b/privoxy.init @@ -1,13 +1,23 @@ #!/bin/sh +# +# This is file /etc/rc.d/init.d/privoxy and was put here +# by the privoxy rpm +# +# chkconfig: 2345 84 09 +# +# description: This shell script takes care of starting and stopping \ +# privoxy. +# + # ******************************************************************** # # File : $Source: /cvsroot/ijbswa/current/privoxy.init,v $ # # Purpose : This shell script takes care of starting and stopping -# privoxy. +# privoxy on Red Hat and RH compatible systems. # -# Copyright : Written by and Copyright (C) 2001 the SourceForge -# PRIVOXY team. http://ijbswa.sourceforge.net +# Copyright : Written by and Copyright (C) 2001,2002 the SourceForge +# Privoxy team. http://www.privoxy.org/ # # Based on the Internet Junkbuster originally written # by and Copyright (C) 1997 Anonymous Coders and @@ -33,6 +43,36 @@ # # Revisions : # $Log: privoxy.init,v $ +# Revision 1.9 2002/09/05 15:38:30 oes +# Synced with the stable branch: +# 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. +# +# Revision 1.3 2002/03/24 19:12:15 hal9 +# Fixed some naming conflicts. +# +# Revision 1.2 2002/03/24 11:40:14 swa +# name change +# # Revision 1.1 2002/03/24 11:23:44 swa # name change # @@ -136,15 +176,6 @@ # # ********************************************************************/ -# 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 @@ -154,40 +185,39 @@ # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 -JB_OPRG="privoxy" -JB_PRG="jbng" -JB_BIN="/usr/sbin/$JB_PRG" -JB_CONF="/etc/$JB_OPRG/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 @@ -201,8 +231,8 @@ case "$1" in stop ;; reload) - if [ -f $JB_PID ] ; then - kill -HUP `cat $JB_PID` + if [ -f $PRIVOXY_PID ] ; then + kill -HUP `cat $PRIVOXY_PID` RETVAL=$? fi ;; @@ -213,27 +243,27 @@ case "$1" in ;; 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