name change
[privoxy.git] / privoxy.init.suse
1 #! /bin/sh
2 #  ********************************************************************
3
4 #  File        :  $Source: /cvsroot/ijbswa/current/junkbuster.init.suse,v $
5
6 #  Purpose     :  This shell script takes care of starting and stopping
7 #                 junkbuster.
8
9 #  Copyright   :  Written by and Copyright (C) 2001 the SourceForge
10 #                 IJBSWA team.  http://ijbswa.sourceforge.net
11
12 #                 Based on the Internet Junkbuster originally written
13 #                 by and Copyright (C) 1997 Anonymous Coders and
14 #                 Junkbusters Corporation.  http://www.junkbusters.com
15
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.
21
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.
27
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.
33
34 #  Revisions   :
35 #     $Log: junkbuster.init.suse,v $
36 #     Revision 1.7  2002/03/11 11:44:46  oes
37 #     Working in suggestions by Thorsten Kukuk <kukuk@suse.de>
38 #
39 #     Revision 1.6  2002/03/09 14:56:34  swa
40 #     wrong user.group
41 #
42 #     Revision 1.5  2002/03/08 21:39:59  oes
43 #     setgid to nogroup
44 #
45 #     Revision 1.4  2002/03/05 19:54:37  oes
46 #     Preliminary version of SuSE 8.0-certified init script ,-)
47 #
48 #     Revision 1.3  2002/03/05 05:28:05  oes
49 #     Added pidfile creation
50 #
51 #     Revision 1.2  2001/09/10 16:25:46  swa
52 #     jb did not start. none of the arguments worked. fixed.
53 #
54 #     Revision 1.1  2001/06/08 20:53:36  swa
55 #     use buildroot, export init to separate file (better manageability)
56 #
57 #
58
59 # ********************************************************************/
60 ### BEGIN INIT INFO
61 # Provides:       junkbuster ijb
62 # Required-Start: $network $syslog $remote_fs
63 # Required-Stop:
64 # Default-Start:  3 5
65 # Default-Stop:   0 1 2 6
66 # Description:    Starts the Internet Junkbuster
67 ### END INIT INFO
68
69 . /etc/rc.config
70 rc_reset  
71
72 case "$1" in
73     start)
74         echo -n "Starting The Internet Junkbuster"
75         if [ ! -f /var/run/junkbuster.pid ] || ! kill -0 `cat /var/run/junkbuster.pid` 2> /dev/null; then
76            /usr/sbin/junkbuster --user junkbuster.junkbuster --pidfile /var/run/junkbuster.pid /etc/junkbuster/config 2> /dev/null
77         else     
78            false 
79         fi
80         rc_status -v
81         ;;
82     stop)
83         echo -n "Shutting down The Internet Junkbuster"
84         killproc -TERM /usr/sbin/junkbuster && rm -f /var/run/junkbuster.pid
85         rc_status -v
86         ;;
87     reload)
88         echo -n "Reloading The Internet Junkbuster"
89         kill -HUP `cat /var/run/junkbuster.pid`
90         rc_status -v
91         ;;
92     try-restart)
93         $0 stop && $0 start
94         rc_status
95         ;;
96     restart)
97         $0 stop
98         $0 start
99         rc_status
100         ;;           
101     status)
102         echo -n "Checking for The Internet Junkbuster"
103         checkproc /usr/sbin/junkbuster
104         rc_status -v
105         ;;
106     *)
107         echo "Usage: $0 {start|restart|reload|status|stop}"
108         exit 1
109 esac
110
111 rc_exit