Default to ask a password
This commit is contained in:
parent
d279ee6010
commit
9af8762610
25
ssh-askpass
25
ssh-askpass
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user