iopsys-feed/iwatchdog/files/etc/init.d/iwatchdog
2018-01-02 14:19:30 +01:00

39 lines
623 B
Bash

#!/bin/sh /etc/rc.common
START=10
STOP=99
USE_PROCD=1
NAME=iwatchdog
PROG=/sbin/iwatchdog
fill_in_default()
{
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=watchdog
/sbin/uci set system.watchdog.enable=no
/sbin/uci commit
}
start_service() {
enable=$(/sbin/uci get system.watchdog.enable)
case $enable in
0|no|NO|false|FALSE)
exit 0
;;
"")
fill_in_default
exit 0
;;
esac
procd_open_instance
procd_set_param command "$PROG"
procd_set_param respawn
procd_close_instance
}
#stop() {
# service_stop /sbin/iwatchdog
#}