ramips: rt305x: add support for the ZyXEL NBG-419N board
[openwrt.git] / target / linux / ramips / base-files / etc / uci-defaults / nw718
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 #
5
6 nw718_set_macs() {
7 local part
8 local lan_mac
9 local wan_mac
10
11 [ -z $(which maccalc) ] && return
12
13 . /etc/functions.sh
14
15 part=$(find_mtd_part "factory")
16 [ -z $part ] && return
17
18 lan_mac=$(dd bs=1 skip=4 count=6 if=$part 2>/dev/null | maccalc bin2mac)
19 [ -z $lan_mac ] && return
20
21 wan_mac=$(maccalc add $lan_mac 1)
22
23 uci batch <<EOF
24 set network.lan.macaddr='$lan_mac'
25 set network.wan.macaddr='$wan_mac'
26 commit network
27 EOF
28 }
29
30 nw718_set_leds() {
31 uci batch <<EOF
32 set system.usb_led=led
33 set system.usb_led.name='USB'
34 set system.usb_led.sysfs='nw718:amber:usb'
35 set system.usb_led.trigger='usbdev'
36 set system.usb_led.dev='1-1'
37 set system.usb_led.interval='50'
38 commit system
39 EOF
40 }
41
42 . /lib/ramips.sh
43
44 board=$(ramips_board_name)
45
46 if [ "${board}" == "nw718" ]; then
47 nw718_set_leds
48 nw718_set_macs
49 fi
This page took 0.0435 seconds and 5 git commands to generate.