uqmi: silence error on pin verification
authorKoen Vandeputte <koen.vandeputte@ncentric.com>
Fri, 19 Jan 2018 10:31:52 +0000 (11:31 +0100)
committerJohn Crispin <john@phrozen.org>
Mon, 22 Jan 2018 07:46:46 +0000 (08:46 +0100)
If a device only supports the 2nd verification method (uim),
the first method will fail as expected reporting an error:

"Command not supported"

Silence both separate methods and only report an error regarding
pin verification if both fail.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh

index 9a534d4..1619c2b 100755 (executable)
@@ -70,7 +70,7 @@ proto_qmi_setup() {
        done
 
        [ -n "$pincode" ] && {
-               uqmi -s -d "$device" --verify-pin1 "$pincode" || uqmi -s -d "$device" --uim-verify-pin1 "$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"
                        proto_notify_error "$interface" PIN_FAILED
                        proto_block_restart "$interface"