- Re-enable OS/2 building after new parms were added
[privoxy.git] / junkbuster.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.3  2002/03/05 05:28:05  oes
37 #     Added pidfile creation
38 #
39 #     Revision 1.2  2001/09/10 16:25:46  swa
40 #     jb did not start. none of the arguments worked. fixed.
41 #
42 #     Revision 1.1  2001/06/08 20:53:36  swa
43 #     use buildroot, export init to separate file (better manageability)
44 #
45 #
46
47 # ********************************************************************/
48 ### BEGIN INIT INFO
49 # Provides:       junkbuster ijb
50 # Required-Start: $network $syslog $remote_fs
51 # Required-Stop:
52 # Default-Start:  3 5
53 # Default-Stop:   0 1 2 6
54 # Description:    Starts the Internet Junkbuster
55 ### END INIT INFO
56
57 . /etc/rc.config
58 rc_reset  
59
60 case "$1" in
61     start)
62         echo -n "Starting The Internet Junkbuster"
63         if [ ! -f /var/run/junkbuster.pid ] || ! kill -0 `cat /var/run/junkbuster.pid` 2> /dev/null; then
64            /usr/sbin/junkbuster --user nobody --pidfile /var/run/junkbuster.pid /etc/junkbuster/config 2> /dev/null
65
66 # SuSE: Ist der else-Teil nötig?
67
68         else     
69            false 
70         fi
71         rc_status -v
72         ;;
73     stop)
74         echo -n "Shutting down The Internet Junkbuster"
75         killproc -TERM /usr/sbin/junkbuster && rm -f /var/run/junkbuster.pid
76         rc_status -v
77         ;;
78     reload)
79         echo -n "Reloading The Internet Junkbuster"
80         kill -HUP `cat /var/run/junkbuster.pid`
81         rc_status -v
82         ;;
83     restart)
84         $0 stop && $0 start
85         rc_status
86         ;;
87     status)
88         echo -n "Checking for The Internet Junkbuster"
89         checkproc /usr/sbin/junkbuster
90         rc_status -v
91         ;;
92     *)
93         echo "Usage: $0 {start|restart|reload|status|stop}"
94         exit 1
95 esac
96
97 # SuSE: Kann das so ersetzt werden?
98
99 #test "$return" = "$rc_done" || exit 1
100 #exit 0
101
102 rc_exit