The use of sort means that tap10 and tap1 don't sort correctly. Tweak
the shell expression to correctly handle numbers of tap devices of 10
or more.

Signed-off-by: Richard Purdie <[email protected]>
---
 scripts/runqemu-ifup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index e3aa16c97df..5dc765dee82 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -38,7 +38,7 @@ USERID="-u $1"
 GROUP="-g $2"
 
 if taps=$(ip tuntap list 2>/dev/null); then
-       tap_no=$(( $(echo "$taps" |sort -r |sed 's/^tap//; s/:.*//; q') + 1 ))
+       tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed 's/tap//g' | sort -rn 
| head -n 1) + 1 ))
        ip tuntap add tap$tap_no mode tap group $2 && TAP=tap$tap_no
 fi
 
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183118): 
https://lists.openembedded.org/g/openembedded-core/message/183118
Mute This Topic: https://lists.openembedded.org/mt/99624733/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to