wok-6.x view privoxy/stuff/daemon-privoxy @ rev 17024
usbids: up 20140731
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Aug 14 09:20:02 2014 +0000 (2014-08-14) |
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