wok view slim/stuff/etc/init.d/slim @ 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 d0948455b365
children ff5fd8788cd9
line source
1 #!/bin/sh
2 # /etc/init.d/slim: Start, stop and restart Slim deamon on SliTaz, at boot
3 # 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/slim.conf.
7 #
8 . /etc/init.d/rc.functions
10 NAME=SLiM
11 DESC="$(_ 'Simple login manager')"
12 DAEMON=/usr/bin/slim
13 OPTION="-d"
14 LOCK_FILE=/var/lock/slim.lock
16 case "$1" in
17 start)
18 if active_pidfile $LOCK_FILE slim ; then
19 _ '%s is already running.' $NAME
20 exit 1
21 fi
22 action 'Starting %s: %s...' "$DESC" $NAME
23 $DAEMON $OPTION
24 status
25 ;;
26 stop)
27 if ! active_pidfile $LOCK_FILE slim ; then
28 _ '%s is not running.' $NAME
29 exit 1
30 fi
31 action 'Stopping %s: %s...' "$DESC" $NAME
32 killall slim
33 rm $LOCK_FILE
34 status
35 ;;
36 restart)
37 if ! active_pidfile $LOCK_FILE slim ; then
38 _ '%s is not running.' $NAME
39 exit 1
40 fi
41 action 'Restarting %s: %s...' "$DESC" $NAME
42 killall slim
43 rm $LOCK_FILE
44 sleep 2
45 $DAEMON $OPTION
46 status
47 ;;
48 *)
49 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
50 newline
51 exit 1
52 ;;
53 esac
55 exit 0