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:
parent
e2822c9d80
commit
dced576bfe
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue