wok-6.x view lxnetdaemon/stuff/etc/init.d/lxnetdaemon @ rev 19161
Typos in "daemon"...
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri May 27 01:40:23 2016 +0300 (2016-05-27) |
parents | 7f188676b59c |
children |
line source
1 #!/bin/sh
2 # /etc/init.d/lxnetdaemon: Start, stop and restart LXnetdaemon daemon on
3 # 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=LXnetdaemon
12 DESC="$(_ 'Network daemon')"
13 DAEMON=/usr/bin/lxnetdaemon
14 PIDFILE=/var/run/lxnetdaemon.pid
16 case "$1" in
17 start)
18 if active_pidfile $PIDFILE lxnetdaemon ; then
19 _ '%s is already running.' $NAME
20 exit 1
21 fi
22 action 'Starting %s: %s...' "$DESC" $NAME
23 $DAEMON $OPTIONS
24 status
25 pidof lxnetdaemon > $PIDFILE
26 ;;
27 stop)
28 if ! active_pidfile $PIDFILE lxnetdaemon ; then
29 _ '%s is not running.' $NAME
30 exit 1
31 fi
32 action 'Stopping %s: %s...' "$DESC" $NAME
33 kill $(cat $PIDFILE)
34 rm $PIDFILE
35 status
36 ;;
37 restart)
38 if ! active_pidfile $PIDFILE lxnetdaemon ; then
39 _ '%s is not running.' $NAME
40 exit 1
41 fi
42 action 'Restarting %s: %s...' "$DESC" $NAME
43 kill $(cat $PIDFILE)
44 rm $PIDFILE
45 sleep 2
46 $DAEMON $OPTIONS
47 status
48 pidof lxnetdaemon > $PIDFILE
49 ;;
50 *)
51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
52 newline
53 exit 1
54 ;;
55 esac
57 exit 0