mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-31 16:35:44 +00:00
ramips: use maccalc instead of hexdump + sed
SVN-Revision: 28007
This commit is contained in:
parent
bfc47ffead
commit
ace8ce0845
@ -8,15 +8,16 @@ nw718_set_macs() {
|
|||||||
local lan_mac
|
local lan_mac
|
||||||
local wan_mac
|
local wan_mac
|
||||||
|
|
||||||
|
[ -z $(which maccalc) ] && return
|
||||||
|
|
||||||
. /etc/functions.sh
|
. /etc/functions.sh
|
||||||
|
|
||||||
part=$(find_mtd_part "factory")
|
part=$(find_mtd_part "factory")
|
||||||
[ -z $part ] && return
|
[ -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 $lan_mac ] && return
|
||||||
|
|
||||||
[ -z $(which maccalc) ] && return
|
|
||||||
wan_mac=$(maccalc add $lan_mac 1)
|
wan_mac=$(maccalc add $lan_mac 1)
|
||||||
|
|
||||||
uci batch <<EOF
|
uci batch <<EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user