1
0

Default to ask a password

This commit is contained in:
Thibault “Adædra” Hamel 2024-04-18 01:08:33 +02:00
parent d279ee6010
commit 9af8762610

View File

@ -2,20 +2,29 @@
PINENTRY=@pinentry_mac@/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac
function send() {
print -p "$@"
read -p
}
coproc $PINENTRY
PINENTRY_PID=$!
trap "kill -TERM $PINENTRY_PID" INT TERM
read -p
print -p SETDESC $@
read -p
send SETDESC $@
print -p SETOK Hide
read -p
print -p CONFIRM --one-button
read -p
case "$@" in
"Confirm user presence"*)
send SETOK Hide
send CONFIRM --one-button
;;
*)
send GETPIN
test "${REPLY:0:3}" = ERR && { coproc : ; exit 1 }
echo ${REPLY:2}
;;
esac
# Close the coproc
coproc :
exit 1