From dced576bfe90021f74eed12c6bc6006c370b7782 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 26 Sep 2024 09:57:53 +0200 Subject: [PATCH] modemmanager: fix value call with modemmanager_get_field function The correct values are prefixed with 'modem.generic'. This is missing for the value 'state' and 'state-failed-reason. While we're at it, let's move the readout of 'state-failed-reason' to the failed case, because that's the only place it's needed. Signed-off-by: Florian Eckert --- net/modemmanager/files/lib/netifd/proto/modemmanager.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh index 562f2e3c37..9da65935cf 100644 --- a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh +++ b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh @@ -315,12 +315,11 @@ modemmanager_check_state() { local state reason - state="$(modemmanager_get_field "${modemstatus}" "state")" - state="${state%% *}" - reason="$(modemmanager_get_field "${modemstatus}" "state-failed-reason")" + state="$(modemmanager_get_field "${modemstatus}" "modem.generic.state")" case "$state" in "failed") + reason="$(modemmanager_get_field "${modemstatus}" "modem.generic.state-failed-reason")" case "$reason" in "sim-missing") echo "SIM missing" -- 2.30.2