aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifdown
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu-ifdown')
-rwxr-xr-xscripts/runqemu-ifdown10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/runqemu-ifdown b/scripts/runqemu-ifdown
index ffbc9de442..2486968588 100755
--- a/scripts/runqemu-ifdown
+++ b/scripts/runqemu-ifdown
@@ -51,6 +51,16 @@ fi
$TUNCTL -d $TAP
+IFCONFIG=`which ip 2> /dev/null`
+if [ "x$IFCONFIG" = "x" ]; then
+ # better than nothing...
+ IFCONFIG=/sbin/ip
+fi
+if [ -x "$IFCONFIG" ]; then
+ if `$IFCONFIG link show $TAP > /dev/null 2>&1`; then
+ $IFCONFIG link del $TAP
+ fi
+fi
# cleanup the remaining iptables rules
IPTABLES=`which iptables 2> /dev/null`
if [ "x$IPTABLES" = "x" ]; then