ar71xx: enable sysupgrade for the OpenMesh A60
[openwrt/openwrt.git] / package / kernel / om-watchdog / files / om-watchdog.init
1 #!/bin/sh /etc/rc.common
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 #
5
6 START=11
7 STOP=11
8
9 USE_PROCD=1
10 NAME=om-watchdog
11 PROG=/sbin/om-watchdog
12
13 get_gpio() {
14 if [ -r /lib/ar71xx.sh ]; then
15 . /lib/ar71xx.sh
16 local board=$(ar71xx_board_name)
17
18 case "$board" in
19 "om2p" | \
20 "om2pv4" | \
21 "om2p-hs" | \
22 "om2p-hsv2" | \
23 "om2p-hsv3" | \
24 "om2p-hsv4" | \
25 "om5p-acv2")
26 return 12
27 ;;
28 "om2pv2" | \
29 "om2p-lc")
30 return 26
31 ;;
32 "om5p" | \
33 "om5p-an")
34 return 11
35 ;;
36 "om5p-ac")
37 return 17
38 ;;
39 "mr600v2")
40 return 15
41 ;;
42 "mr900" | \
43 "mr900v2" | \
44 "mr1750" | \
45 "mr1750v2")
46 return 16
47 ;;
48 esac
49 else
50 #we assume it is om1p in this case
51 return 3
52 fi
53
54 return 255
55 }
56
57 start_service() {
58 get_gpio
59 gpio="$?"
60 [ "$gpio" != "255" ] || return
61
62 procd_open_instance
63 procd_set_param command "${PROG}" "${gpio}"
64 procd_set_param respawn
65 procd_close_instance
66 }