aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeiger <geigereitan@gmail.com>2017-03-07 17:23:08 +0200
committerJan Macku <jamacku@redhat.com>2021-06-24 12:07:01 +0200
commit81b7893dd1627c43464064e670583803aca2d5ff (patch)
treee688a149458d9a0ffc60aacffd37f19938a3a7dc
parent55cdbccad3f6492b1e721154a45e5884044db76d (diff)
downloadinitscripts-81b7893dd1627c43464064e670583803aca2d5ff.tar
initscripts-81b7893dd1627c43464064e670583803aca2d5ff.tar.gz
initscripts-81b7893dd1627c43464064e670583803aca2d5ff.tar.bz2
initscripts-81b7893dd1627c43464064e670583803aca2d5ff.tar.xz
initscripts-81b7893dd1627c43464064e670583803aca2d5ff.zip
ifdown removes veth pair if both peers are down
-rwxr-xr-xnetwork-scripts/ifdown-eth6
1 files changed, 6 insertions, 0 deletions
diff --git a/network-scripts/ifdown-eth b/network-scripts/ifdown-eth
index 7b457e85..8d62200f 100755
--- a/network-scripts/ifdown-eth
+++ b/network-scripts/ifdown-eth
@@ -180,4 +180,10 @@ if [ -n "$VLAN" ]; then
fi
fi
+if [ "${TYPE}" = "Veth" ]; then
+ if [ $(ip link show ${PEER} up | wc -l) -eq 0 ]; then
+ ip link delete ${DEVICE}
+ fi
+fi
+
exit $retcode