fix unlocksim
The set -e was causing the script to exit when sxmo_dmenu.sh close was executed (since this would fail more often than not). This makes the logic simpler too. Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:

committed by
Maarten van Gompel

parent
0c725fd7d8
commit
51ffb34c97
@@ -7,8 +7,6 @@
|
|||||||
# shellcheck source=scripts/core/sxmo_icons.sh
|
# shellcheck source=scripts/core/sxmo_icons.sh
|
||||||
. "$(which sxmo_icons.sh)"
|
. "$(which sxmo_icons.sh)"
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# in dwm, close any dmenus. We don't need to do this in sway.
|
# in dwm, close any dmenus. We don't need to do this in sway.
|
||||||
[ "$SXMO_WM" = "dwm" ] && sxmo_dmenu.sh close
|
[ "$SXMO_WM" = "dwm" ] && sxmo_dmenu.sh close
|
||||||
|
|
||||||
@@ -26,11 +24,14 @@ EOF
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
SIM="$(mmcli -m any | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2)"
|
SIM="$(mmcli -m any | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2)"
|
||||||
MSG="$(mmcli -i "$SIM" --pin "$PICKED" 2>&1)" || continue
|
MSG="$(mmcli -i "$SIM" --pin "$PICKED" 2>&1)"
|
||||||
[ -n "$MSG" ] && sxmo_notify_user.sh "$MSG"
|
[ -n "$MSG" ] && sxmo_notify_user.sh "$MSG"
|
||||||
if printf "%s\n" "$MSG" | grep -q "not SIM-PIN locked"; then
|
if printf "%s\n" "$MSG" | grep -q "not SIM-PIN locked"; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
if printf "%s\n" "$MSG" | grep -q "successfully sent PIN code to the SIM"; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user