From: Florian Eckert Date: Thu, 26 Sep 2024 07:57:53 +0000 (+0200) Subject: modemmanager: fix value call with modemmanager_get_field function X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=dced576bfe90021f74eed12c6bc6006c370b7782;p=openwrt-packages.git 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 --- diff --git a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh index 562f2e3c3..9da65935c 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"