diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-19 15:46:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-19 15:50:29 +0100 |
commit | 18df7280ce92801ddc0ea8ca2a6a559e86981246 (patch) | |
tree | f69d7dd9c11155284fb9fd2d83187a027e5a4f8f /scripts | |
parent | 51063c1e6ac214b4ef43c88c8091c909a7cab2cb (diff) | |
download | poky-18df7280ce92801ddc0ea8ca2a6a559e86981246.tar.gz |
scripts/runqemu-ifup: Fix 10 or more tap devices
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.
(From OE-Core rev: 4c6d0f3ddbb76bde7f35edeb280fe56a9a00f91b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu-ifup | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index e3aa16c97d..5dc765dee8 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup | |||
@@ -38,7 +38,7 @@ USERID="-u $1" | |||
38 | GROUP="-g $2" | 38 | GROUP="-g $2" |
39 | 39 | ||
40 | if taps=$(ip tuntap list 2>/dev/null); then | 40 | if taps=$(ip tuntap list 2>/dev/null); then |
41 | tap_no=$(( $(echo "$taps" |sort -r |sed 's/^tap//; s/:.*//; q') + 1 )) | 41 | tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed 's/tap//g' | sort -rn | head -n 1) + 1 )) |
42 | ip tuntap add tap$tap_no mode tap group $2 && TAP=tap$tap_no | 42 | ip tuntap add tap$tap_no mode tap group $2 && TAP=tap$tap_no |
43 | fi | 43 | fi |
44 | 44 | ||