Commit 9614d039 authored by Alexander Couzens's avatar Alexander Couzens
Browse files

qmiconnect: handle only the first application

parent 77368477
......@@ -24,7 +24,7 @@ is_sim_unlocked() {
fi
for i in $(seq 1 5) ; do
appstate=$(_qmicli --uim-get-card-status 2>/dev/null | grep "Application state: " | awk '{ print $3 }' | sed "s/'//g")
appstate=$(_qmicli --uim-get-card-status 2>/dev/null | grep "Application state: " | head -n1 | awk '{ print $3 }' | sed "s/'//g")
# checking state means we need to wait
if [ "$appstate" = "check-personalization-state" ] ; then
sleep 1
......@@ -44,7 +44,7 @@ unlock_sim() {
exit 1
fi
retries=$(_qmicli --uim-get-card-status 2>/dev/null | grep "PIN1 retries:" | awk '{ print $3 }' | sed "s/'//g")
retries=$(_qmicli --uim-get-card-status 2>/dev/null | grep "PIN1 retries:" | head -n1 | awk '{ print $3 }' | sed "s/'//g")
if [ "$retries" != 2 ] && [ "$retries" != 3 ] ; then
_err "PIN required but this is the last try! Don't try to use the last try"
exit 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment