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 <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2024-09-26 09:57:53 +02:00 committed by Robert Marko
parent e2822c9d80
commit dced576bfe
1 changed files with 2 additions and 3 deletions

View File

@ -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"