ramips: fix read mac for jdcloud re-sp-01b again

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-11-14 13:41:22 +08:00
parent 2546d5098f
commit 7ec8108be5
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 2 additions and 2 deletions

View File

@ -286,7 +286,7 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
jdcloud,re-sp-01b)
lan_mac=$(mtd_get_mac_ascii config mac)
lan_mac=$(macaddr_canonicalize "$(strings "$(find_mtd_part config)" | sed -n 's/^'"mac"'=//p' | head -n1)")
wan_mac=$lan_mac
label_mac=$lan_mac
;;

View File

@ -127,7 +127,7 @@ case "$board" in
macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
;;
jdcloud,re-sp-01b)
addr=$(mtd_get_mac_ascii config mac)
addr=$(macaddr_canonicalize "$(strings "$(find_mtd_part config)" | sed -n 's/^'"mac"'=//p' | head -n1)")
[ "$PHYNBR" = "0" ] && echo $addr > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 0x800000 > /sys${DEVPATH}/macaddress
;;