summaryrefslogtreecommitdiff
path: root/target/linux/ramips/base-files/etc/uci-defaults
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-08-15 19:00:23 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-08-15 19:00:23 +0000
commit36991e85202afd9f0db52d564f44ccb53b38ec55 (patch)
tree2473d5f80f859f87691f42fd66dde6af1cf71609 /target/linux/ramips/base-files/etc/uci-defaults
parentf64a3c86106762363215bda1796ead6f1adcbea2 (diff)
ramips: use maccalc instead of hexdump + sed
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28007 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/base-files/etc/uci-defaults')
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/nw7185
1 files changed, 3 insertions, 2 deletions
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/nw718 b/target/linux/ramips/base-files/etc/uci-defaults/nw718
index 4ce3bc9af8..590b65913e 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/nw718
+++ b/target/linux/ramips/base-files/etc/uci-defaults/nw718
@@ -8,15 +8,16 @@ nw718_set_macs() {
local lan_mac
local wan_mac
+ [ -z $(which maccalc) ] && return
+
. /etc/functions.sh
part=$(find_mtd_part "factory")
[ -z $part ] && return
- lan_mac=$(dd bs=1 skip=4 count=6 if=$part 2>/dev/null | hexdump -v -e '1/1 "%02x"' | sed 's/\(..\)/\1:/g;s/:$//')
+ lan_mac=$(dd bs=1 skip=4 count=6 if=$part 2>/dev/null | maccalc bin2mac)
[ -z $lan_mac ] && return
- [ -z $(which maccalc) ] && return
wan_mac=$(maccalc add $lan_mac 1)
uci batch <<EOF