diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2010-11-01 10:37:03 +0100 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-11-01 10:40:38 -0400 |
commit | 1dedc710c01a48fa493c2922e4000e64415bb120 (patch) | |
tree | 6718f493dde8fd7d786a5fb32b8b02e8225c76eb /sysconfig/network-scripts | |
parent | 9d2e2d459038a25477dacde8239f646e935862bd (diff) | |
download | initscripts-1dedc710c01a48fa493c2922e4000e64415bb120.tar initscripts-1dedc710c01a48fa493c2922e4000e64415bb120.tar.gz initscripts-1dedc710c01a48fa493c2922e4000e64415bb120.tar.bz2 initscripts-1dedc710c01a48fa493c2922e4000e64415bb120.tar.xz initscripts-1dedc710c01a48fa493c2922e4000e64415bb120.zip |
Fix ifdown calling nmcli for NM-managed devices; others are handled by ifdown-${DEVICETYPE} (#612934).
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 2 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index f308d317..db045da4 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -45,7 +45,7 @@ if [ "$USE_NM" = "true" ]; then if [ -n "$UUID" -a -z "$DEVICE" ]; then DEVICE=$(nmcli -t --fields uuid,devices con status | awk -F ':' "\$1 == \"$UUID\" { print \$2 }") fi - if [ -n "$DEVICE" ] && is_nm_active "$DEVICE" ; then + if [ -n "$DEVICE" ] && ! is_nm_device_unmanaged "$DEVICE" ; then nmcli dev disconnect iface "$DEVICE" exit $? fi diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index e72c8098..68ff961a 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -209,6 +209,11 @@ is_nm_active () LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^${1}:connected$" } +is_nm_device_unmanaged () +{ + LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^${1}:unmanaged$" +} + # Sets $alias to the device module if $? != 0 is_available () { |