mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-18 21:28:02 +00:00
base-files: strip space and tab characters from ASCII mac address
Spaces and tabs are widely used in variable definitions. We have to remove them to ensure that get_mac_ascii() works properly. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
This commit is contained in:
parent
9e3064fdbf
commit
bc596b5f75
@ -66,7 +66,7 @@ get_mac_ascii() {
|
||||
local key="$2"
|
||||
local mac_dirty
|
||||
|
||||
mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p' | head -n 1)
|
||||
mac_dirty=$(strings "$part" | tr -d ' \t' | sed -n 's/^'"$key"'=//p' | head -n 1)
|
||||
|
||||
# "canonicalize" mac
|
||||
[ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty"
|
||||
|
Loading…
Reference in New Issue
Block a user