wok view tinyproxy/stuff/tinyproxy @ rev 19159

/etc/init.d/*: use 'action' in pair with 'status'.
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 26 20:16:45 2016 +0300 (2016-05-26)
parents 156441c8051a
children ff5fd8788cd9
line source
1 #!/bin/sh
2 # /etc/init.d/tinyproxy: Start, stop and restart tinyproxy deamon on SliTaz
4 . /etc/init.d/rc.functions
6 NAME=Tinyproxy
7 DESC="$(_ 'Tiny Proxy')"
8 DAEMON=/usr/sbin/tinyproxy
9 OPTION="-c"
10 PIDFILE=/var/run/tinyproxy.pid
12 case "$1" in
13 start)
14 if active_pidfile $PIDFILE tinyproxy ; then
15 _ '%s is already running.' $NAME
16 exit 1
17 fi
18 action 'Starting %s: %s...' "$DESC" $NAME
19 $DAEMON $OPTION /etc/tinyproxy/tinyproxy.conf
20 status
21 ;;
22 stop)
23 if ! active_pidfile $PIDFILE tinyproxy ; then
24 _ '%s is not running.' $NAME
25 exit 1
26 fi
27 action 'Stopping %s: %s...' "$DESC" $NAME
28 killall tinyproxy
29 rm $PIDFILE
30 status
31 ;;
32 restart)
33 if ! active_pidfile $PIDFILE tinyproxy ; then
34 _ '%s is not running.' $NAME
35 exit 1
36 fi
37 action 'Restarting %s: %s...' "$DESC" $NAME
38 killall tinyproxy
39 rm $PIDFILE
40 sleep 2
41 $DAEMON $OPTION /etc/tinyproxy/tinyproxy.conf
42 status
43 ;;
44 *)
45 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
46 newline
47 exit 1
48 ;;
49 esac
51 exit 0