diff options
Diffstat (limited to 'package/network/utils/uqmi/files/lib/netifd/proto')
-rwxr-xr-x | package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index c0134f44dd..156e57b135 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -94,7 +94,8 @@ proto_qmi_setup() { fi done - if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"\|"Invalid QMI command"' > /dev/null; then + if uqmi -s -d "$device" --uim-get-sim-state | grep -q '"Not supported"\|"Invalid QMI command"' && + uqmi -s -d "$device" --get-pin-status | grep -q '"Not supported"\|"Invalid QMI command"' ; then [ -n "$pincode" ] && { uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || { echo "Unable to verify PIN" @@ -105,7 +106,8 @@ proto_qmi_setup() { } else . /usr/share/libubox/jshn.sh - json_load "$(uqmi -s -d "$device" --get-pin-status)" + json_load "$(uqmi -s -d "$device" --get-pin-status)" 2>&1 | grep -q Failed && + json_load "$(uqmi -s -d "$device" --uim-get-sim-state)" json_get_var pin1_status pin1_status json_get_var pin1_verify_tries pin1_verify_tries @@ -144,7 +146,7 @@ proto_qmi_setup() { echo "PIN already verified" ;; *) - echo "PIN status failed ($pin1_status)" + echo "PIN status failed (${pin1_status:-sim_not_present})" proto_notify_error "$interface" PIN_STATUS_FAILED proto_block_restart "$interface" return 1 |