wok view privoxy/stuff/daemon-privoxy @ rev 20651
Up dietlibc (0.34), musl-libc (1.1.20)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jan 13 10:11:20 2019 +0100 (2019-01-13) |
parents | b6858242c35f |
children |
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 _ '%s is already running.' $NAME
23 exit 1
24 fi
25 action 'Starting %s: %s...' "$DESC" $NAME
26 $DAEMON $OPTIONS $USER $CONFIG 2>/dev/null
27 status
28 ;;
29 stop)
30 if ! active_pidfile $PIDFILE privoxy ; then
31 _ '%s is not running.' $NAME
32 exit 1
33 fi
34 action 'Stopping %s: %s...' "$DESC" $NAME
35 kill $(cat $PIDFILE)
36 rm $PIDFILE
37 status
38 ;;
39 restart)
40 if ! active_pidfile $PIDFILE privoxy ; then
41 _ '%s is not running.' $NAME
42 exit 1
43 fi
44 kill $(cat $PIDFILE)
45 rm $PIDFILE
46 sleep 2
47 action 'Restarting %s: %s...' "$DESC" $NAME
48 $DAEMON $OPTIONS $USER $CONFIG 2>/dev/null
49 status
50 ;;
51 *)
52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
53 newline
54 exit 1
55 ;;
56 esac
58 exit 0