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