d3525ea0c9389df73f6f29635a3c75554b883d18
[openwrt/staging/chunkeey.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,ea7300-v1|\
13 linksys,ea7300-v2|\
14 linksys,ea7500-v2|\
15 linksys,ea8100-v1)
16 mtd resetbc s_env || true
17 ;;
18 samknows,whitebox-v8)
19 fw_setenv bootcount 0
20 ;;
21 zyxel,nr7101)
22 [ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] || fw_setenv DebugFlag 0x1
23 [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1
24 [ $(printf %d $(fw_printenv -n Image1Try)) -gt 0 ] && fw_setenv Image1Try 0
25 ;;
26 esac
27 }