summaryrefslogtreecommitdiff
path: root/poky/scripts/runqemu-ifdown
diff options
context:
space:
mode:
Diffstat (limited to 'poky/scripts/runqemu-ifdown')
-rwxr-xr-xpoky/scripts/runqemu-ifdown14
1 files changed, 8 insertions, 6 deletions
diff --git a/poky/scripts/runqemu-ifdown b/poky/scripts/runqemu-ifdown
index e0eb5344c6..f72166b32b 100755
--- a/poky/scripts/runqemu-ifdown
+++ b/poky/scripts/runqemu-ifdown
@@ -33,13 +33,15 @@ fi
TAP=$1
STAGING_BINDIR_NATIVE=$2
-TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
-if [ ! -e "$TUNCTL" ]; then
- echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native"
- exit 1
-fi
+if !ip tuntap del $TAP mode tap 2>/dev/null; then
+ TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
+ if [ ! -e "$TUNCTL" ]; then
+ echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native"
+ exit 1
+ fi
-$TUNCTL -d $TAP
+ $TUNCTL -d $TAP
+fi
IFCONFIG=`which ip 2> /dev/null`
if [ "x$IFCONFIG" = "x" ]; then