From 55c6b42696e074106a937ad406f14afe40f3a3af Mon Sep 17 00:00:00 2001 From: Rohit Nair Date: Wed, 18 Sep 2024 09:50:18 -0700 Subject: [PATCH] network-functions: Fix a bug in is_nm_handling() Currently the "^" anchor is applied to the "connected" case and does not apply to the "connecting" case in the grep due to the way the brackets () are placed. This can cause the grep statement to incorrectly return a match. For ex: When trying to check for eth0 using is_nm_handling(), "bondeth0:connecting" would also match the grep and return incorrectly. Signed-off-by: Rohit Nair --- network-scripts/network-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network-scripts/network-functions b/network-scripts/network-functions index 89c0bcaf..86e1b80c 100644 --- a/network-scripts/network-functions +++ b/network-scripts/network-functions @@ -302,7 +302,7 @@ is_nm_active () is_nm_handling () { - LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$" + LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^\(${1}:connected\|${1}:connecting.*\)$" } is_nm_device_unmanaged ()