mvebu: set default regdomain
[openwrt/openwrt.git] / target / linux / mvebu / base-files / etc / uci-defaults / 03_wireless
1 #!/bin/sh
2 #
3 # Copyright (C) 2015 OpenWrt.org
4 #
5
6 [ ! -e /etc/config/wireless ] && exit 0
7
8 . /lib/mvebu.sh
9
10 board=$(mvebu_board_name)
11
12 case "$board" in
13 armada-xp-mamba)
14 SKU=$(strings /dev/mtd3|sed -ne 's/^cert_region=//p')
15 case "$SKU" in
16 US)
17 REGD=US
18 ;;
19 EU)
20 REGD=DE
21 ;;
22 esac
23 uci get wireless.radio0.country || uci set wireless.radio0.country=$REGD
24 uci get wireless.radio1.country || uci set wireless.radio1.country=$REGD
25 ;;
26 esac
27
28 uci commit wireless
29
30 exit 0