2 # Sample script for scdaemon event mechanism.
4 #exec >>/tmp/scd-event.log
15 while [ $# -gt 0 ]; do
18 -*=*) optarg
=$
(echo "X$arg" |
sed -e '1s/^X//' -e 's/[-_a-zA-Z0-9]*=//')
23 if [ -n "$prev" ]; then
33 $PGM is called by scdaemon on card reader status changes
36 --reader-port N Reports change for port N
37 --old-code 0xNNNN Previous status code
38 --old-code 0xNNNN Current status code
39 --status USABLE|ACTIVE|PRESENT|NOCARD
40 Human readable status code
44 GNUPGHOME=DIR Set to the active homedir
76 echo "$PGM: invalid option $tick$arg'" >&2
86 if [ -n "$prev" ]; then
87 echo "$PGM: argument missing for option $tick$prev'" >&2
92 ========================
99 if [ x
$status = xUSABLE
]; then
100 gpg
--batch --card-status 2>&1