diff options
author | Geiger <geigereitan@gmail.com> | 2017-03-07 17:23:08 +0200 |
---|---|---|
committer | Jan Macku <jamacku@redhat.com> | 2021-06-24 12:07:01 +0200 |
commit | 81b7893dd1627c43464064e670583803aca2d5ff (patch) | |
tree | e688a149458d9a0ffc60aacffd37f19938a3a7dc /network-scripts/ifdown-eth | |
parent | 55cdbccad3f6492b1e721154a45e5884044db76d (diff) | |
download | initscripts-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
Diffstat (limited to 'network-scripts/ifdown-eth')
-rwxr-xr-x | network-scripts/ifdown-eth | 6 |
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 |