aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ixp4xx/base-files/etc/preinit.arch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ixp4xx/base-files/etc/preinit.arch')
-rwxr-xr-xtarget/linux/ixp4xx/base-files/etc/preinit.arch8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/ixp4xx/base-files/etc/preinit.arch b/target/linux/ixp4xx/base-files/etc/preinit.arch
new file mode 100755
index 0000000000..1ee1d7404d
--- /dev/null
+++ b/target/linux/ixp4xx/base-files/etc/preinit.arch
@@ -0,0 +1,8 @@
+RB_CONFIG="$(grep "RedBoot config" /proc/mtd | cut -d: -f1)"
+
+for npe in eth0 eth1
+do
+ if [ "$(ifconfig $npe 2>/dev/null | grep -c 00:00:00:00:00:00)" == "1" ]; then
+ ifconfig $npe hw ether $(fconfig -s -r -d /dev/$RB_CONFIG -n npe_"$npe"_esa)
+ fi
+done