flm01/mote/v1/openwrt/package/flukso/src/flukso.init

18 lines
476 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Copyright (c) 2008-2009 jokamajo.org
# $Id$
START=98
start() {
stty 4800 -echo -onlcr < /dev/ttyS0
/usr/share/lua/flukso/flukso.lua >&- 2>&- <&- &
/usr/share/lua/flukso/heartbeat.lua 1 >&- 2>&- <&-
echo -e "$(date '+%M') * * * * /usr/share/lua/flukso/heartbeat.lua 0\n"'*/15 * * * * [ -z "$(ps | grep '\'flukso.lu[a]\'')" ] && reboot' | crontab -
}
stop() {
crontab -r
kill -SIGKILL $(ps | grep 'flukso.lu[a]' | awk '{print $1}')
}