Changes to implement redhat-dok (Hal Burgiss)
[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.2  2001/09/10 16:25:46  swa
37 #     jb did not start. none of the arguments worked. fixed.
38 #
39 #     Revision 1.1  2001/06/08 20:53:36  swa
40 #     use buildroot, export init to separate file (better manageability)
41 #
42 #
43
44 # ********************************************************************/
45 ### BEGIN INIT INFO
46 # Provides:       junkbuster ijb
47 # Required-Start: $network syslog
48 # Required-Stop:
49 # Default-Start:  3 5
50 # Default-Stop:
51 # Description:    Starts the Internet Junkbuster
52 ### END INIT INFO
53 . /etc/rc.config
54 base=\${0##*/}
55 link=\${base#*[SK][0-9][0-9]}
56 #test \$link = \$base && START_IJB=yes
57 #test "\$START_IJB" = "yes" || exit 0
58 return=$rc_done
59 case "$1" in
60     start)
61         echo -n "Starting The Internet Junkbuster"
62         su - nobody -c 'nohup /usr/sbin/junkbuster --pidfile /var/run/junkbuster.pid /etc/junkbuster/config < /dev/null > /dev/null &'
63         sleep 1
64         echo -e "$return"
65         ;;
66     stop)
67         echo -n "Shutting down The Internet Junkbuster"
68         killproc -TERM /usr/sbin/junkbuster || return=$rc_failed
69         echo -e "$return"
70         ;;
71     restart|reload)
72         $0 stop && $0 start || return=$rc_failed
73         ;;
74     status)
75         checkproc /usr/sbin/junkbuster && echo OK || echo No process
76         ;;
77     *)
78         echo "Usage: $0 {start|restart|status|stop}"
79         exit 1
80 esac
81 test "$return" = "$rc_done" || exit 1
82 exit 0