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() {
|
2012-01-04 17:30:39 +00:00
|
|
|
if [ -r /lib/ar71xx.sh ]; then
|
|
|
|
. /lib/ar71xx.sh
|
|
|
|
local board=$(ar71xx_board_name)
|
|
|
|
|
2012-10-17 08:26:03 +00:00
|
|
|
case "$board" in
|
2016-03-03 20:24:35 +00:00
|
|
|
"om2p" | \
|
2016-06-02 09:31:47 +00:00
|
|
|
"om2pv4" | \
|
2016-03-03 20:24:35 +00:00
|
|
|
"om2p-hs" | \
|
2016-04-09 10:26:25 +00:00
|
|
|
"om2p-hsv2" | \
|
2016-05-20 15:53:10 +00:00
|
|
|
"om2p-hsv3" | \
|
2016-06-02 09:31:47 +00:00
|
|
|
"om2p-hsv4" | \
|
2016-04-09 10:26:25 +00:00
|
|
|
"om5p-acv2")
|
2016-03-03 20:24:33 +00:00
|
|
|
return 12
|
2012-10-17 08:26:03 +00:00
|
|
|
;;
|
2016-03-03 20:24:35 +00:00
|
|
|
"om2pv2" | \
|
|
|
|
"om2p-lc")
|
2016-03-03 20:24:33 +00:00
|
|
|
return 26
|
2012-10-17 08:26:03 +00:00
|
|
|
;;
|
2016-03-03 20:24:35 +00:00
|
|
|
"om5p" | \
|
|
|
|
"om5p-an")
|
2016-03-03 20:24:33 +00:00
|
|
|
return 11
|
2014-07-20 17:30:56 +00:00
|
|
|
;;
|
2016-04-09 10:26:01 +00:00
|
|
|
"om5p-ac")
|
|
|
|
return 17
|
|
|
|
;;
|
2013-02-01 15:50:49 +00:00
|
|
|
"mr600v2")
|
2016-03-03 20:24:33 +00:00
|
|
|
return 15
|
2013-02-01 15:50:49 +00:00
|
|
|
;;
|
2016-03-03 20:24:35 +00:00
|
|
|
"mr900" | \
|
|
|
|
"mr900v2" | \
|
2016-05-20 15:53:16 +00:00
|
|
|
"mr1750" | \
|
2016-08-09 14:01:50 +00:00
|
|
|
"mr1750v2" | \
|
2016-09-23 07:38:10 +00:00
|
|
|
"a40" | \
|
2016-08-09 14:01:50 +00:00
|
|
|
"a60")
|
2016-03-03 20:24:33 +00:00
|
|
|
return 16
|
2014-11-14 16:54:38 +00:00
|
|
|
;;
|
2012-10-17 08:26:03 +00:00
|
|
|
esac
|
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
|
|
|
}
|