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