mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 09:12:39 +00:00
f12a32630f
Use the generic function instead ot the target specific ones. Signed-off-by: Mathias Kresin <dev@kresin.me>
74 lines
949 B
Bash
74 lines
949 B
Bash
#!/bin/sh /etc/rc.common
|
|
#
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
#
|
|
|
|
START=11
|
|
STOP=11
|
|
|
|
USE_PROCD=1
|
|
NAME=om-watchdog
|
|
PROG=/sbin/om-watchdog
|
|
|
|
get_gpio() {
|
|
local board=$(board_name)
|
|
|
|
if [ -r /lib/ar71xx.sh ]; then
|
|
case "$board" in
|
|
"a40"|\
|
|
"a60"|\
|
|
"mr1750"|\
|
|
"mr1750v2"|\
|
|
"mr900"|\
|
|
"mr900v2")
|
|
return 16
|
|
;;
|
|
"mr600v2")
|
|
return 15
|
|
;;
|
|
"om2p"|\
|
|
"om2p-hs"|\
|
|
"om2p-hsv2"|\
|
|
"om2p-hsv3"|\
|
|
"om2p-hsv4"|\
|
|
"om2pv4"|\
|
|
"om5p-acv2")
|
|
return 12
|
|
;;
|
|
"om2p-lc"|\
|
|
"om2pv2")
|
|
return 26
|
|
;;
|
|
"om5p"|\
|
|
"om5p-an")
|
|
return 11
|
|
;;
|
|
"om5p-ac")
|
|
return 17
|
|
;;
|
|
esac
|
|
elif [ -r /lib/ramips.sh ]; then
|
|
case "$board" in
|
|
"rut5xx")
|
|
return 11
|
|
;;
|
|
esac
|
|
else
|
|
#we assume it is om1p in this case
|
|
return 3
|
|
fi
|
|
|
|
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
|
|
}
|