aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifdown7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 6bd1073d..b78e9438 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -46,8 +46,11 @@ if [ "$_use_nm" = "true" ]; then
DEVICE=$(nmcli -t --fields uuid,devices con status | awk -F ':' "\$1 == \"$UUID\" { print \$2 }")
fi
if [ -n "$DEVICE" ] && ! is_nm_device_unmanaged "$DEVICE" ; then
- nmcli dev disconnect iface "$DEVICE"
- exit $?
+ if ! LC_ALL=C nmcli -t -f STATE,DEVICE dev status | egrep -q "^(failed|disconnected|unmanaged|unavailable):$DEVICE$"; then
+ nmcli dev disconnect iface "$DEVICE"
+ exit $?
+ fi
+ exit 0
fi
fi