wok view unfs3/stuff/etc/init.d/unfsd @ 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 1b6281d68d9f
children
line source
1 #!/bin/sh
2 # /etc/init.d/unfsd : Start, stop and restart NFSv3 Server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start NFSv3 Server at boot time, just put dropbear 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=unfsd
12 DESC="$(_ '%s server' NFSv3)"
13 DAEMON=/usr/bin/unfsd
14 OPTIONS=
15 PIDFILE=/var/run/$NAME.pid
18 test -f $DAEMON || exit 0
20 case "$1" in
21 start)
22 if active_pidfile $PIDFILE unfsd ; then
23 _ '%s is already running.' $NAME
24 exit 1
25 fi
27 action 'Starting %s: %s...' "$DESC" $NAME
28 $DAEMON $OPTIONS
29 status
31 # registering PID
32 if [ $? -eq 0 ]; then
33 pidof -s $NAME > $PIDFILE
34 fi
35 ;;
36 stop)
37 if ! active_pidfile $PIDFILE unfsd ; then
38 _ '%s is not running.' $NAME
39 exit 1
40 fi
41 action 'Stopping %s: %s...' "$DESC" $NAME
42 kill $(cat $PIDFILE)
43 rm -f $PIDFILE
44 status
45 ;;
46 restart)
47 $0 stop
48 $0 start
49 ;;
50 *)
51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
52 newline
53 exit 1
54 ;;
55 esac
57 exit 0