aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-03-04 12:30:07 -0500
committerBill Nottingham <notting@redhat.com>2010-03-04 12:30:07 -0500
commitdf1656625a2bca974e7171159eff731ee5ff76ed (patch)
tree22bc6c2da453f6aab730ff503382d8e8e20da76d
parent15051e3dce738cc64a1b1224c91513487fee7bbe (diff)
downloadinitscripts-df1656625a2bca974e7171159eff731ee5ff76ed.tar
initscripts-df1656625a2bca974e7171159eff731ee5ff76ed.tar.gz
initscripts-df1656625a2bca974e7171159eff731ee5ff76ed.tar.bz2
initscripts-df1656625a2bca974e7171159eff731ee5ff76ed.tar.xz
initscripts-df1656625a2bca974e7171159eff731ee5ff76ed.zip
Pull device from NetworkManager, if possible.
Requires a fairly recent nmcli.
-rwxr-xr-xsysconfig/network-scripts/ifdown11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index fd766427..addf7345 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -41,9 +41,14 @@ then
exit 0
fi
-if [ "$USE_NM" = "true" ]] && is_nm_active "$DEVICE" ; then
- nmcli dev disconnect iface "$DEVICE"
- exit $?
+if [ "$USE_NM" = "true" ]; then
+ if [ -n "$UUID" -a -z "$DEVICE" ]; then
+ DEVICE=$(nmcli con status | awk "\$4 == \"$UUID\" { print \$3 }")
+ fi
+ if [ -n "$DEVICE" ] && is_nm_active "$DEVICE" ; then
+ nmcli dev disconnect iface "$DEVICE"
+ exit $?
+ fi
fi
if [ -x /sbin/ifdown-pre-local ]; then