2 # ********************************************************************
4 # File : $Source: /cvsroot/ijbswa/current/junkbuster.init,v $
6 # Purpose : This shell script takes care of starting and stopping
9 # Copyright : Written by and Copyright (C) 2001 the SourceForge
10 # IJBSWA team. http://ijbswa.sourceforge.net
12 # Based on the Internet Junkbuster originally written
13 # by and Copyright (C) 1997 Anonymous Coders and
14 # Junkbusters Corporation. http://www.junkbusters.com
16 # This program is free software; you can redistribute it
17 # and/or modify it under the terms of the GNU General
18 # Public License as published by the Free Software
19 # Foundation; either version 2 of the License, or (at
20 # your option) any later version.
22 # This program is distributed in the hope that it will
23 # be useful, but WITHOUT ANY WARRANTY; without even the
24 # implied warranty of MERCHANTABILITY or FITNESS FOR A
25 # PARTICULAR PURPOSE. See the GNU General Public
26 # License for more details.
28 # The GNU General Public License should be included with
29 # this file. If not, you can view it at
30 # http://www.gnu.org/copyleft/gpl.html
31 # or write to the Free Software Foundation, Inc., 59
32 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 # $Log: junkbuster.init,v $
36 # Revision 1.9 2001/09/15 01:53:12 steudten
38 # Remove test for subsys flag in start. Some minor changes.
40 # Revision 1.8 2001/06/28 13:50:36 sarantis
41 # swap ?$ with $?; remove bogus ";;"
43 # Revision 1.7 2001/06/28 13:40:26 sarantis
44 # remove single quotes from $JB; it was not expanded.
46 # Revision 1.6 2001/06/28 13:38:42 sarantis
47 # formatting changes; individual return values are returned from the init script.
49 # Revision 1.5 2001/06/11 11:37:40 sarantis
50 # Minor editing changes.
52 # Revision 1.4 2001/06/09 09:14:11 swa
53 # shamelessly adapted RPM stuff from the newest rpm that
54 # RedHat provided for the JB.
56 # Revision 1.3 2001/05/25 10:12:44 oes
57 # Fixed default case in switch statement (# -> *)
59 # Revision 1.2 2001/05/24 07:52:24 swa
60 # added header. removed ^M.
63 # ********************************************************************/
65 # This is file /etc/rc.d/init.d/junkbuster and was put here
66 # by the junkbuster rpm
68 # chkconfig: 235 84 09
70 # description: This shell script takes care of starting and stopping \
74 # Source function library.
75 . /etc/rc.d/init.d/functions
77 . /etc/sysconfig/network
79 # Check that networking is up.
80 [ ${NETWORKING} = "no" ] && exit 0
83 JB_BIN="/usr/sbin/$JB_PRG"
84 JB_CONF="/etc/$JB_PRG/config"
88 [ -x $JB_BIN ] || exit 0
89 [ -f $JB_CONF ] || exit 0
91 # See how we were called.
97 echo -n $"Starting $JB_PRG: "
98 daemon --user $JB_USER $JB
101 [ $RETVAL = 0 ] && touch /var/lock/subsys/$JB_PRG
107 echo -n $"Stopping $JB_PRG: "
108 killproc $JB_PRG && rm -f /var/lock/subsys/$JB_PRG
127 # restart only if already running
128 if [ -f /var/lock/subsys/$JB_PRG ] ; then
139 echo $"Usage: $JB_PRG {start|stop|reload|restart|condrestart|status}"