mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-09 23:34:51 +01:00
service_stop is a legacy function and it should never be used with procd services which are automatically stopped by /etc/rc.common Also remove unnecessary boot() which just runs the "start" function.
34 lines
577 B
Bash
34 lines
577 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
|
|
}
|