2012-01-04 17:30:39 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
#
|
|
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
START=11
|
2016-03-03 20:24:33 +00:00
|
|
|
STOP=11
|
2012-01-04 17:30:39 +00:00
|
|
|
|
2016-03-03 20:24:33 +00:00
|
|
|
USE_PROCD=1
|
|
|
|
NAME=om-watchdog
|
|
|
|
PROG=/sbin/om-watchdog
|
2012-01-04 17:30:39 +00:00
|
|
|
|
2016-03-03 20:24:33 +00:00
|
|
|
get_gpio() {
|
2017-05-12 20:36:07 +00:00
|
|
|
local board=$(board_name)
|
2012-01-04 17:30:39 +00:00
|
|
|
|
2020-08-07 13:25:12 +00:00
|
|
|
if [ "$board" = "teltonika,rut5xx" ]; then
|
2019-07-03 21:22:44 +00:00
|
|
|
# ramips
|
|
|
|
return 11
|
2012-01-04 17:30:39 +00:00
|
|
|
else
|
|
|
|
#we assume it is om1p in this case
|
2016-03-03 20:24:33 +00:00
|
|
|
return 3
|
2012-01-04 17:30:39 +00:00
|
|
|
fi
|
2016-03-03 20:24:33 +00:00
|
|
|
|
|
|
|
return 255
|
|
|
|
}
|
|
|
|
|
|
|
|
start_service() {
|
|
|
|
get_gpio
|
|
|
|
gpio="$?"
|
|
|
|
[ "$gpio" != "255" ] || return
|
|
|
|
|
|
|
|
procd_open_instance
|
|
|
|
procd_set_param command "${PROG}" "${gpio}"
|
|
|
|
procd_set_param respawn
|
|
|
|
procd_close_instance
|
2012-01-04 17:30:39 +00:00
|
|
|
}
|