Added LICENSE, pdfs, privoxy-index and HTMLized man-page to docs
[privoxy.git] / debian / init.d
1 #! /bin/sh
2
3 PATH=/sbin:/bin:/usr/sbin:/usr/bin
4 DAEMON=/usr/sbin/privoxy
5 NAME=privoxy
6 DESC="filtering proxy server"
7 OWNER=privoxy
8 CONFIGFILE=/etc/privoxy/config
9 PIDFILE=/var/run/$NAME.pid
10
11 test -f $DAEMON || exit 0
12
13 set -e
14
15 case "$1" in
16   start)
17         echo -n "Starting $DESC: "
18         $DAEMON --pidfile $PIDFILE --user $OWNER $CONFIGFILE 2>/dev/null
19         echo "$NAME."
20         ;;
21   stop)
22         echo -n "Stopping $DESC: "
23         start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
24                 --exec $DAEMON
25         echo "$NAME."
26         ;;
27   #reload)
28         #
29         #       If the daemon can reload its config files on the fly
30         #       for example by sending it SIGHUP, do it here.
31         #
32         #       If the daemon responds to changes in its config file
33         #       directly anyway, make this a do-nothing entry.
34         #
35         # echo "Reloading $DESC configuration files."
36         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
37         #       /var/run/$NAME.pid --exec $DAEMON
38   #;;
39   restart|force-reload)
40         #
41         #       If the "reload" option is implemented, move the "force-reload"
42         #       option to the "reload" entry above. If not, "force-reload" is
43         #       just the same as "restart".
44         #
45         echo "Restarting $DESC: "
46         start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
47                 --exec $DAEMON
48         sleep 1
49         $DAEMON --pidfile $PIDFILE --user $OWNER $CONFIGFILE
50         ;;
51   *)
52         N=/etc/init.d/$NAME
53         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
54         echo "Usage: $N {start|stop|restart|force-reload}" >&2
55         exit 1
56         ;;
57 esac
58
59 exit 0