4 # Most devices have a standard "VCTL" partition
5 CONFIG_PARTITION
="$(grep "VCTL
" /proc/mtd | cut -d: -f1)"
6 if [ ! -z $CONFIG_PARTITION ] ; then
7 MAC1
="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f2|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')"
8 MAC2
="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f8|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')"
10 ifconfig eth0 hw ether
$MAC1 2>/dev
/null
11 ifconfig eth1 hw ether
$MAC2 2>/dev
/null
15 # The DNS-313 has a special field in its RedBoot
16 # binary that we need to check
17 CONFIG_PARTITION
="$(grep "RedBoot
" /proc/mtd | cut -d: -f1)"
18 if [ ! -z $CONFIG_PARTITION ] ; then
19 DEVID
="$(dd if=/dev/mtdblock0 bs=1 skip=119508 count=7 2>/dev/null)"
20 if [ "x$DEVID" = "xdns-313" ] ; then
21 MAC1
="$(dd if=/dev/mtdblock0 bs=1 skip=119540 count=6 2>/dev/null | hexdump -n6 -e '/1 ":%02X
"' | sed s/^://g)"
22 ifconfig eth0 hw ether
$MAC1 2>/dev
/null
28 boot_hook_add preinit_main set_ether_mac