8382bdf0c52b3f5fbb52d9db80a0a1f64717cb36
[openwrt/openwrt.git] / target / linux / ramips / mt7621 / base-files / etc / init.d / bootcount
1 #!/bin/sh /etc/rc.common
2
3 START=99
4
5 boot() {
6 case $(board_name) in
7 alfa-network,quad-e4g)
8 [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\
9 echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s -
10 ;;
11 linksys,e5600|\
12 linksys,ea6350-v4|\
13 linksys,ea7300-v1|\
14 linksys,ea7300-v2|\
15 linksys,ea7500-v2|\
16 linksys,ea8100-v1|\
17 linksys,ea8100-v2)
18 mtd resetbc s_env || true
19 ;;
20 samknows,whitebox-v8)
21 fw_setenv bootcount 0
22 ;;
23 zyxel,nr7101)
24 [ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] || fw_setenv DebugFlag 0x1
25 [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1
26 [ $(printf %d $(fw_printenv -n Image1Try)) -gt 0 ] && fw_setenv Image1Try 0
27 ;;
28 esac
29 }