Enable FEATURE_CONNECTION_KEEP_ALIVE unconditionally. Enable FEATURE_CONNECTION_SHARI...
[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 # ********************************************************************/
35 ### BEGIN INIT INFO
36 # Provides:       privoxy
37 # Required-Start: $network $syslog $remote_fs
38 # Required-Stop:
39 # Default-Start:  3 5
40 # Default-Stop:   0 1 2 6
41 # Description:    Starts Privoxy
42 ### END INIT INFO
43
44 . /etc/rc.status
45 rc_reset  
46
47 case "$1" in
48     start)
49         echo -n "Starting Privoxy"
50         if [ ! -f /var/run/privoxy.pid ] || ! kill -0 `cat /var/run/privoxy.pid` 2> /dev/null; then
51            /usr/sbin/privoxy --user privoxy.privoxy --pidfile /var/run/privoxy.pid /etc/privoxy/config 2> /dev/null
52         else     
53            false 
54         fi
55         rc_status -v
56         ;;
57     stop)
58         echo -n "Shutting down Privoxy"
59         killproc -TERM /usr/sbin/privoxy && rm -f /var/run/privoxy.pid
60         rc_status -v
61         ;;
62     reload)
63         echo -n "Reloading Privoxy"
64         kill -HUP `cat /var/run/privoxy.pid`
65         rc_status -v
66         ;;
67     try-restart)
68         $0 stop && $0 start
69         rc_status
70         ;;
71     restart)
72         $0 stop
73         $0 start
74         rc_status
75         ;;           
76     status)
77         echo -n "Checking for Privoxy"
78         checkproc /usr/sbin/privoxy
79         rc_status -v
80         ;;
81     *)
82         echo "Usage: $0 {start|restart|reload|status|stop}"
83         exit 1
84 esac
85
86 rc_exit