projects
/
openwrt
/
staging
/
svanheule.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
676dfd1
)
base-files: strip space and tab characters from ASCII mac address
author
Shiji Yang
<yangshiji66@qq.com>
Mon, 16 Dec 2024 07:09:50 +0000
(15:09 +0800)
committer
Hauke Mehrtens
<hauke@hauke-m.de>
Sat, 4 Jan 2025 18:25:34 +0000
(19:25 +0100)
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>
Link:
https://github.com/openwrt/openwrt/pull/17262
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit
551e04f3c9c063d885ca7a91db36f27f684a3a5c
)
package/base-files/files/lib/functions/system.sh
patch
|
blob
|
history
diff --git
a/package/base-files/files/lib/functions/system.sh
b/package/base-files/files/lib/functions/system.sh
index aaeb75f26164af6bac0820eb629a768ca65a5a90..f43281b5dceb071b8e586b8d1931a2836162378a 100644
(file)
--- a/
package/base-files/files/lib/functions/system.sh
+++ b/
package/base-files/files/lib/functions/system.sh
@@
-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"