aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifdown2
-rw-r--r--sysconfig/network-scripts/network-functions4
2 files changed, 3 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index addf7345..f308d317 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -43,7 +43,7 @@ fi
if [ "$USE_NM" = "true" ]; then
if [ -n "$UUID" -a -z "$DEVICE" ]; then
- DEVICE=$(nmcli con status | awk "\$4 == \"$UUID\" { print \$3 }")
+ DEVICE=$(nmcli -t --fields uuid,devices con status | awk -F ':' "\$1 == \"$UUID\" { print \$2 }")
fi
if [ -n "$DEVICE" ] && is_nm_active "$DEVICE" ; then
nmcli dev disconnect iface "$DEVICE"
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index c8846ef8..9fc84bca 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -201,12 +201,12 @@ do_netreport ()
is_nm_running ()
{
- LANG=C nmcli nm status 2>/dev/null| grep -Eq "NM running:[[:space:]]+running"
+ [ "$(LANG=C nmcli -t --fields running nm status 2>/dev/null)" = "running" ]
}
is_nm_active ()
{
- LANG=C nmcli -t dev status 2>/dev/null| grep -Eq "^${1}[[:space:]]*.*[[:space:]]*connected"
+ LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^${1}:connected$"
}
# Sets $alias to the device module if $? != 0