mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-01 00:45:28 +00:00
mediatek: filogic: avoid sub-shell invovation in netdev rename loop
Rename network devices to their label set in DT without invocation of a sub-shell. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 983222605ce6fabb036fbbd5797b6689ed082136)
This commit is contained in:
parent
1dd9f26183
commit
cb2cda24e7
@ -5,8 +5,8 @@ set_netdev_labels() {
|
||||
|
||||
for dir in /sys/class/net/*; do
|
||||
[ -r "$dir/of_node/label" ] || continue
|
||||
label="$(cat "$dir/of_node/label")"
|
||||
netdev="$(basename $dir)"
|
||||
read -r label < "$dir/of_node/label"
|
||||
netdev="${dir##*/}"
|
||||
[ "$netdev" = "$label" ] && continue
|
||||
ip link set "$netdev" name "$label"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user