1b2b04ed4e1a04a8526058b07adc3b8de4bf8278
[project/luci.git] / libs / lucid / root / etc / init.d / lucid
1 #!/bin/sh /etc/rc.common
2 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
3 NAME=lucid
4 DESC="LuCId superserver"
5 START=49
6
7 test -x $DAEMON || exit 0
8 set -e
9
10 start() {
11         echo -n "Starting $DESC: $NAME"
12         lua -lluci.lucid -e 'luci.lucid.start()'
13         echo "."
14 }
15
16 stop() {
17         echo -n "Stopping $DESC: $NAME"
18         lua -lluci.lucid -e 'luci.lucid.stop()'
19         echo "."
20 }
21
22 restart() {
23         # echo -n "Restarting $DESC: $NAME... "
24         # start-stop-daemon -K -s HUP -q -x $DAEMON
25         # echo "done."
26         stop
27         sleep 3
28         start
29 }
30
31 reload() {
32         #
33         #       If the daemon can reload its config files on the fly
34         #       for example by sending it SIGHUP, do it here.
35         #
36         #       If the daemon responds to changes in its config file
37         #       directly anyway, make this a do-nothing entry.
38         #
39         # echo -n "Reloading $DESC configuration... "
40         # start-stop-daemon -K -s 1 -q -x $DAEMON
41         # echo "done."
42         restart
43 }