Migrate PCRE_H_IN_SUBDIR from 3.0 branch for pcre/pcre.h on RH, etc.
[privoxy.git] / privoxy-generic.init
1 #!/bin/sh
2
3 #  ********************************************************************
4
5 #  File        :  $Source: /cvsroot/ijbswa/current/privoxy.init,v $
6
7 #  Purpose     :  This shell script takes care of starting and stopping
8 #                 privoxy.
9
10 #  Copyright   :  Written by and Copyright (C) 2001,2002 the SourceForge
11 #                 Privoxy team. http://www.privoxy.org/
12
13 #                 Based on the Internet Junkbuster originally written
14 #                 by and Copyright (C) 1997 Anonymous Coders and
15 #                 Junkbusters Corporation.  http://www.junkbusters.com
16
17 #                 This program is free software; you can redistribute it
18 #                 and/or modify it under the terms of the GNU General
19 #                 Public License as published by the Free Software
20 #                 Foundation; either version 2 of the License, or (at
21 #                 your option) any later version.
22
23 #                 This program is distributed in the hope that it will
24 #                 be useful, but WITHOUT ANY WARRANTY; without even the
25 #                 implied warranty of MERCHANTABILITY or FITNESS FOR A
26 #                 PARTICULAR PURPOSE.  See the GNU General Public
27 #                 License for more details.
28
29 #                 The GNU General Public License should be included with
30 #                 this file.  If not, you can view it at
31 #                 http://www.gnu.org/copyleft/gpl.html
32 #                 or write to the Free Software Foundation, Inc., 59
33 #                 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
34
35 #  Revisions   :
36 #     $Log: privoxy-generic.init,v $
37 #     Revision 1.0  2002/09/05 17:14:32  hal9
38 #
39 #######################################################################
40
41 # Is this needed by Solaris?
42 #ident  "@(#)privoxy  1.0     02/09/05"
43
44 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin/:/usr/bin:/sbin:/bin
45 NAME=Privoxy
46 DAEMON=privoxy
47 P_CONF_FILE=/etc/${NAME}/config
48 PIDFILE=/var/run/${NAME}.pid
49 #RUN_AS="--user privoxy"
50
51 if [ ! -f $P_CONF_FILE ]; then
52   echo "Can't find $P_CONF_FILE, exiting."
53   exit 1
54 fi
55
56 case "$1" in
57  
58  start)
59      test -f $PIDFILE && echo "$PIDFILE exists, exiting." && exit 1
60         echo -n "Starting $NAME: "
61         $DAEMON --pidfile $PIDFILE $RUN_AS $P_CONF_FILE 2>/dev/null &&\
62      echo "OK." || echo "Failed."
63         
64      ;;
65  
66  restart)
67      $0 stop
68      $0 start
69      ;;
70  
71  stop)
72         echo -n "Stopping $NAME: "
73      kill `cat $PIDFILE` &&\
74      echo "OK." || echo "Failed."
75      ;;
76  
77  *)
78      echo "Usage: $0 {start|stop|restart}"
79      exit 1
80      ;;
81 esac
82
83 exit 0