diff options
author | Petr Horáček <phoracek@redhat.com> | 2017-01-30 18:47:11 +0100 |
---|---|---|
committer | Lukáš Nykrýn <lnykryn@redhat.com> | 2017-02-14 18:57:12 +0100 |
commit | 0c48e8d8a32c6db7f5c5c2a20355d0f3d76deda9 (patch) | |
tree | 44b30ebe5fe1c342d552a9690d63dc0b553c011f | |
parent | 2ea1dcf2d22606f4b30ae16a14a736d0d9dddf24 (diff) | |
download | initscripts-0c48e8d8a32c6db7f5c5c2a20355d0f3d76deda9.tar initscripts-0c48e8d8a32c6db7f5c5c2a20355d0f3d76deda9.tar.gz initscripts-0c48e8d8a32c6db7f5c5c2a20355d0f3d76deda9.tar.bz2 initscripts-0c48e8d8a32c6db7f5c5c2a20355d0f3d76deda9.tar.xz initscripts-0c48e8d8a32c6db7f5c5c2a20355d0f3d76deda9.zip |
network: check for running NetworkManager via dbus
Use dbus instead of nmcli to make ifup command faster.
-rw-r--r-- | sysconfig/network-scripts/network-functions | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 46db1cab..95256bed 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -277,7 +277,11 @@ do_netreport () is_nm_running () { - [ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ] + dbus-send --system --print-reply \ + --dest=org.freedesktop.DBus \ + /org/freedesktop/DBus \ + org.freedesktop.DBus.GetNameOwner \ + string:"org.freedesktop.NetworkManager" >/dev/null 2>&1 } is_nm_active () |