kirkwood: add support for Ctera C200 V1 NAS
[openwrt/openwrt.git] / target / linux / kirkwood / base-files / sbin / ctera_c200-v1_back_to_factory
1 #!/bin/sh
2
3 . /lib/functions.sh
4
5 case $(board_name) in
6 ctera,c200-v1)
7 part=$(find_mtd_part "active_bank")
8
9 if [ -n "$part" ]; then
10 active_bank="$(strings $part | grep bank)"
11
12 if [ $active_bank = "bank1" ]; then
13 echo "bank2" > /tmp/change_bank
14 else
15 echo "bank1" > /tmp/change_bank
16 fi
17
18 mtd write /tmp/change_bank active_bank
19 reboot
20 else
21 echo "active_bank partition missed!"
22 return 1
23 fi
24 ;;
25 *)
26 echo "Unsupported hardware."
27 ;;
28 esac