aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-05-05 12:20:00 -0400
committerBill Nottingham <notting@redhat.com>2010-05-05 12:20:00 -0400
commit2b784ad0b77c5a4f15e9af1535ed79b35d8ae6f4 (patch)
tree286ec7fc69739f6f21c2f90cac184f68faa4d809 /sysconfig/network-scripts
parent722c1ebc058e181c65996b32f3a1147159969975 (diff)
downloadinitscripts-2b784ad0b77c5a4f15e9af1535ed79b35d8ae6f4.tar
initscripts-2b784ad0b77c5a4f15e9af1535ed79b35d8ae6f4.tar.gz
initscripts-2b784ad0b77c5a4f15e9af1535ed79b35d8ae6f4.tar.bz2
initscripts-2b784ad0b77c5a4f15e9af1535ed79b35d8ae6f4.tar.xz
initscripts-2b784ad0b77c5a4f15e9af1535ed79b35d8ae6f4.zip
Update for new nmcli syntax.initscripts-9.12-1
Diffstat (limited to 'sysconfig/network-scripts')
-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