diff options
Diffstat (limited to 'scripts/runqemu-ifup')
-rwxr-xr-x | scripts/runqemu-ifup | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index 9820dc535c..fe4492e78b 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup | |||
@@ -45,8 +45,13 @@ if [ -z "$OE_TAP_NAME" ]; then | |||
45 | fi | 45 | fi |
46 | 46 | ||
47 | if taps=$(ip tuntap list 2>/dev/null); then | 47 | if taps=$(ip tuntap list 2>/dev/null); then |
48 | tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) + 1 )) | 48 | tap_no_last=$(echo "$taps" |cut -f 1 -d ":" |sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) |
49 | ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP="$OE_TAP_NAME$tap_no" | 49 | if [ -z "$tap_no_last" ]; then |
50 | tap_no=0 | ||
51 | else | ||
52 | tap_no=$(("$tap_no_last" + 1)) | ||
53 | fi | ||
54 | ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP=$OE_TAP_NAME$tap_no | ||
50 | fi | 55 | fi |
51 | 56 | ||
52 | if [ -z "$TAP" ]; then | 57 | if [ -z "$TAP" ]; then |