1#!/bin/sh 2 3set_ether_mac() { 4 CONFIG_PARTITION="$(grep "VCTL" /proc/mtd | cut -d: -f1)" 5 MAC1="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f2|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" 6 MAC2="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f8|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" 7 8 ifconfig eth0 hw ether $MAC1 2>/dev/null 9 ifconfig eth1 hw ether $MAC2 2>/dev/null 10} 11 12boot_hook_add preinit_main set_ether_mac 13 14