diff options
author | LukenShiro <lukenshiro@ngi.it> | 2010-05-11 20:02:05 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 20:02:05 +0200 |
commit | be1e4c9cb3bd26c64abbc4420acc466a0e3fe5f2 (patch) | |
tree | 9f9059570c7f7e7d78695a247be05432a2325410 /system/pcsc-lite/rc.pcscd | |
parent | 8ba56473252e017a6287fd72b8805087e8130a19 (diff) | |
download | slackbuilds-be1e4c9cb3bd26c64abbc4420acc466a0e3fe5f2.tar.gz |
system/pcsc-lite: Added to 12.0 repository
Diffstat (limited to 'system/pcsc-lite/rc.pcscd')
-rw-r--r-- | system/pcsc-lite/rc.pcscd | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/system/pcsc-lite/rc.pcscd b/system/pcsc-lite/rc.pcscd new file mode 100644 index 0000000000..480414de62 --- /dev/null +++ b/system/pcsc-lite/rc.pcscd @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Start/Stop/Restart the PC/SC-lite smart card daemon. +# +# pcscd should be started after pcmcia and shut down +# before it for smooth experience with PCMCIA readers. +# + +PIDFILE=/var/run/pcscd.pid +PCSCD_OPTS="" + +# Start +pcscd_start() { + if [ -x /usr/sbin/pcscd ]; then + if [ -e "$PIDFILE" ]; then + echo "PC/SC-lite daemon already started!" + else + echo "Starting PC/SC-lite smart card daemon..." + /usr/sbin/update-reader.conf + /usr/sbin/pcscd $PCSCD_OPTS + fi + fi +} + +# Stop +pcscd_stop() { + echo "Stopping PC/SC-lite smart card daemon..." + if [ -e "$PIDFILE" ]; then + kill $(cat $PIDFILE) + rm -f $PIDFILE + fi + # Just in case: + killall pcscd 1>&2 >/dev/null +} + +# Restart +pcscd_restart() { + pcscd_stop + sleep 3 + pcscd_start +} + +case "$1" in +'start') + pcscd_start + ;; +'stop') + pcscd_stop + ;; +'restart') + pcscd_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |