diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label index f8b6f155de..110e023b96 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label @@ -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