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:
Peter John Hartman
2022-01-31 20:13:25 -06:00
committed by Maarten van Gompel
parent 0c725fd7d8
commit 51ffb34c97

View File

@@ -7,8 +7,6 @@
# shellcheck source=scripts/core/sxmo_icons.sh
. "$(which sxmo_icons.sh)"
set -e
# in dwm, close any dmenus. We don't need to do this in sway.
[ "$SXMO_WM" = "dwm" ] && sxmo_dmenu.sh close
@@ -26,11 +24,14 @@ EOF
;;
*)
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"
if printf "%s\n" "$MSG" | grep -q "not SIM-PIN locked"; then
exit
fi
if printf "%s\n" "$MSG" | grep -q "successfully sent PIN code to the SIM"; then
exit
fi
;;
esac
done