wok view privoxy/stuff/daemon-privoxy @ rev 12418
Split razorqt-power (with upower dep)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 20 18:40:22 2012 +0200 (2012-04-20) |
parents | 10ef56b7f468 |
children | 7f188676b59c |
line source
1 #!/bin/sh
2 # /etc/init.d/daemon-name: Start, stop and restart daemon
3 # on SliTaz, at boot time or with the command line.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Privoxy
12 DESC="Web proxy daemon"
13 DAEMON=/usr/sbin/privoxy
14 OPTIONS="--pidfile /var/run/privoxy.pid"
15 USER="--user privoxy"
16 CONFIG=/etc/privoxy/config
17 PIDFILE=/var/run/privoxy.pid
19 case "$1" in
20 start)
21 if active_pidfile $PIDFILE privoxy ; then
22 echo "$NAME already running."
23 exit 1
24 fi
25 echo -n "Starting $DESC: $NAME... "
26 $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null
27 status
28 ;;
29 stop)
30 if ! active_pidfile $PIDFILE privoxy ; then
31 echo "$NAME is not running."
32 exit 1
33 fi
34 echo -n "Stopping $DESC: $NAME... "
35 kill `cat $PIDFILE`
36 rm $PIDFILE
37 status
38 ;;
39 restart)
40 if ! active_pidfile $PIDFILE privoxy ; then
41 echo "$NAME is not running."
42 exit 1
43 fi
44 kill `cat $PIDFILE`
45 rm $PIDFILE
46 sleep 2
47 echo -n "Restarting $DESC: $NAME... "
48 $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null
49 status
50 ;;
51 *)
52 echo ""
53 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
54 echo ""
55 exit 1
56 ;;
57 esac
59 exit 0