Commit 77368477 authored by Alexander Couzens's avatar Alexander Couzens
Browse files

qmiconnect: handle the uim state check-personalization-state

parent 39111540
......@@ -17,14 +17,24 @@ _qmicli() {
}
is_sim_unlocked() {
local appstate=
if ! _qmicli --uim-get-card-status 2>/dev/null | grep -q "Card state: 'present'" ; then
_err "No Simcard present!"
exit 1
fi
appstate=$(_qmicli --uim-get-card-status 2>/dev/null | grep "Application state: " | awk '{ print $3 }' | sed "s/'//g")
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")
# checking state means we need to wait
if [ "$appstate" = "check-personalization-state" ] ; then
sleep 1
continue
else
break
fi
done
# setting return code
[ "$appstate" = "ready" ]
[ "$appstate" = "ready" ]
}
unlock_sim() {
......
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