X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=privoxy.init;h=ff05a7ece84377ca6dfc6ae3b6d802c447e38a0e;hp=bf52aabad32bf482109887e46e893b653056b598;hb=5a5807409ae15a99c2e7365f292a6de0054257e3;hpb=60adfb320a5a421cf69e91fba0b3c0ad2eb664ae diff --git a/privoxy.init b/privoxy.init index bf52aaba..ff05a7ec 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: 235 84 09 +# +# description: This shell script takes care of starting and stopping \ +# privoxy. +# + # ******************************************************************** # -# File : $Source: /cvsroot/ijbswa/current/junkbusterng.init,v $ +# File : $Source: /cvsroot/ijbswa/current/privoxy.init,v $ # # Purpose : This shell script takes care of starting and stopping -# junkbuster. +# privoxy. # # Copyright : Written by and Copyright (C) 2001 the SourceForge -# IJBSWA 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 @@ -32,7 +42,29 @@ # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Revisions : -# $Log: junkbusterng.init,v $ +# $Log: privoxy.init,v $ +# 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 +# # Revision 1.1 2002/03/22 20:53:03 morcego # - Ongoing process to change name to JunkbusterNG # - configure/configure.in: no change needed @@ -133,15 +165,6 @@ # # ********************************************************************/ -# This is file /etc/rc.d/init.d/junkbuster and was put here -# by the junkbuster rpm -# -# chkconfig: 235 84 09 -# -# description: This shell script takes care of starting and stopping \ -# junkbuster. -# - # Source function library. . /etc/rc.d/init.d/functions @@ -151,40 +174,39 @@ # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 -JB_OPRG="junkbuster" -JB_PRG="jbng" -JB_BIN="/usr/sbin/$JB_PRG" -JB_CONF="/etc/$JB_OPRG/config" -JB_USER="junkbuster" -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 @@ -198,8 +220,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 ;; @@ -210,27 +232,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