aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-02-17 15:32:22 -0500
committerBill Nottingham <notting@redhat.com>2010-04-09 16:35:58 -0400
commit0ad4c421248c3e9fc92c64b09912484d489aed59 (patch)
tree8c087ade25669f3ac24696ff326de70067a08756
parentf71a7bdfebde45f501a801514a2145e720be1b06 (diff)
downloadinitscripts-0ad4c421248c3e9fc92c64b09912484d489aed59.tar
initscripts-0ad4c421248c3e9fc92c64b09912484d489aed59.tar.gz
initscripts-0ad4c421248c3e9fc92c64b09912484d489aed59.tar.bz2
initscripts-0ad4c421248c3e9fc92c64b09912484d489aed59.tar.xz
initscripts-0ad4c421248c3e9fc92c64b09912484d489aed59.zip
When bringing devices down, disconnect the device, don't down the connection.
-rwxr-xr-xsysconfig/network-scripts/ifdown8
-rw-r--r--sysconfig/network-scripts/network-functions5
2 files changed, 7 insertions, 6 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 9c9112cb..31d3f716 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -41,12 +41,8 @@ then
exit 0
fi
-if [ "$USE_NM" = "true" -a -n "$NAME" -o -n "$UUID" ]; then
- if [ -n "$UUID" ]; then
- nmcli con down uuid "$UUID"
- elif [ -n "$NAME" ]; then
- nmcli con down id "$NAME"
- fi
+if [ "$USE_NM" = "true" ]] && is_nm_active "$DEVICE" ; then
+ nmcli dev disconnect iface "$DEVICE"
exit $?
fi
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 88a9757f..b1ecadf1 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -194,6 +194,11 @@ is_nm_running ()
LANG=C nmcli nm status | grep -Eq "NM running:[[:space:]]+running"
}
+is_nm_active ()
+{
+ LANG=C nmcli -t dev status | grep -Eq "^${1}[[:space:]]*.*[[:space:]]*connected$"
+}
+
# Sets $alias to the device module if $? != 0
is_available ()
{