From df1656625a2bca974e7171159eff731ee5ff76ed Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 4 Mar 2010 12:30:07 -0500 Subject: Pull device from NetworkManager, if possible. Requires a fairly recent nmcli. --- sysconfig/network-scripts/ifdown | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sysconfig') 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 -- cgit v1.2.1