aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-08-15 19:00:23 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-08-15 19:00:23 +0000
commitace8ce084517ec118b146f4732ba7382f98bc64f (patch)
treefeac0e298715e417efeb6e5da66753b09a4b5e63 /target
parentbfc47ffead2da4ff9fa198a5e6b77452b326730a (diff)
downloadupstream-ace8ce084517ec118b146f4732ba7382f98bc64f.tar.gz
upstream-ace8ce084517ec118b146f4732ba7382f98bc64f.tar.bz2
upstream-ace8ce084517ec118b146f4732ba7382f98bc64f.zip
ramips: use maccalc instead of hexdump + sed
SVN-Revision: 28007
Diffstat (limited to 'target')
-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