Remove already out-commented line left over from debugging.
[privoxy.git] / privoxy.init.suse
1 #! /bin/sh
2 #  ********************************************************************
3
4 #  File        :  $Source: /cvsroot/ijbswa/current/privoxy.init.suse,v $
5
6 #  Purpose     :  This shell script takes care of starting and stopping
7 #                 privoxy.
8
9 #  Copyright   :  Written by and Copyright (C) 2001 the SourceForge
10 #                 Privoxy team. http://www.privoxy.org/
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: privoxy.init.suse,v $
36 #     Revision 1.3.2.1  2003/03/17 14:04:16  oes
37 #     No longer use obsolete rc.config
38 #
39 #     Revision 1.3  2002/03/26 22:29:55  swa
40 #     we have a new homepage!
41 #
42 #     Revision 1.2  2002/03/24 11:40:14  swa
43 #     name change
44 #
45 #     Revision 1.1  2002/03/24 11:23:44  swa
46 #     name change
47 #
48 #     Revision 1.7  2002/03/11 11:44:46  oes
49 #     Working in suggestions by Thorsten Kukuk <kukuk@suse.de>
50 #
51 #     Revision 1.6  2002/03/09 14:56:34  swa
52 #     wrong user.group
53 #
54 #     Revision 1.5  2002/03/08 21:39:59  oes
55 #     setgid to nogroup
56 #
57 #     Revision 1.4  2002/03/05 19:54:37  oes
58 #     Preliminary version of SuSE 8.0-certified init script ,-)
59 #
60 #     Revision 1.3  2002/03/05 05:28:05  oes
61 #     Added pidfile creation
62 #
63 #     Revision 1.2  2001/09/10 16:25:46  swa
64 #     jb did not start. none of the arguments worked. fixed.
65 #
66 #     Revision 1.1  2001/06/08 20:53:36  swa
67 #     use buildroot, export init to separate file (better manageability)
68 #
69 #
70
71 # ********************************************************************/
72 ### BEGIN INIT INFO
73 # Provides:       privoxy
74 # Required-Start: $network $syslog $remote_fs
75 # Required-Stop:
76 # Default-Start:  3 5
77 # Default-Stop:   0 1 2 6
78 # Description:    Starts Privoxy
79 ### END INIT INFO
80
81 . /etc/rc.status
82 rc_reset  
83
84 case "$1" in
85     start)
86         echo -n "Starting Privoxy"
87         if [ ! -f /var/run/privoxy.pid ] || ! kill -0 `cat /var/run/privoxy.pid` 2> /dev/null; then
88            /usr/sbin/privoxy --user privoxy.privoxy --pidfile /var/run/privoxy.pid /etc/privoxy/config 2> /dev/null
89         else     
90            false 
91         fi
92         rc_status -v
93         ;;
94     stop)
95         echo -n "Shutting down Privoxy"
96         killproc -TERM /usr/sbin/privoxy && rm -f /var/run/privoxy.pid
97         rc_status -v
98         ;;
99     reload)
100         echo -n "Reloading Privoxy"
101         kill -HUP `cat /var/run/privoxy.pid`
102         rc_status -v
103         ;;
104     try-restart)
105         $0 stop && $0 start
106         rc_status
107         ;;
108     restart)
109         $0 stop
110         $0 start
111         rc_status
112         ;;           
113     status)
114         echo -n "Checking for Privoxy"
115         checkproc /usr/sbin/privoxy
116         rc_status -v
117         ;;
118     *)
119         echo "Usage: $0 {start|restart|reload|status|stop}"
120         exit 1
121 esac
122
123 rc_exit