Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 71 lines (69 sloc) 1.45 KB
#!/bin/bash
set -o pipefail
echo OK
while read cmd rest
do
case $cmd in
SETDESC)
DESC=$rest
if [ ${DESC: -3} != '%0A' ]; then
DESC="$DESC%0A"
fi
echo OK
;;
CONFIRM)
echo ASSUAN_Not_Confirmed
;;
SETPROMPT)
PROMPT=$rest
echo OK
;;
SETOK)
OK=$rest
echo OK
;;
SETERROR)
ERROR=$rest
echo OK
;;
GETPIN)
RES=$(emacsclient -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//')
if [ $? -ne 0 ]
then
RES=$(lukspinentry)
fi
echo D $RES
echo OK
;;
OPTION)
echo OK
;;
GETINFO)
case $rest in
pid*)
echo D $$
echo OK
;;
version)
echo D 1.0.0
echo OK
;;
flavor*)
echo D curses:curses
echo OK
;;
ttyinfo*)
echo "D - - -"
echo OK
;;
esac
;;
BYE)
echo OK
exit
;;
*)
echo OK
;;
esac
done