wok diff pcsc-lite/stuff/init.d/pcscd @ rev 13657
pcsc-lite: up to 1.8.6, fix drivers path and add daemon init script
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Nov 21 20:44:31 2012 +0000 (2012-11-21) |
parents | |
children | 39cca942efb8 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/pcsc-lite/stuff/init.d/pcscd Wed Nov 21 20:44:31 2012 +0000 1.3 @@ -0,0 +1,43 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/pcscd: Start, stop and restart pcsc-lite daemon on SliTaz, 1.6 +# at boot time or with the command line. Daemons options are configured 1.7 +# with /etc/daemons.conf 1.8 +# 1.9 +. /etc/init.d/rc.functions 1.10 +. /etc/daemons.conf 1.11 + 1.12 +NAME=Pcscd 1.13 +DESC="PC/SC smart card daemon" 1.14 +DAEMON=/usr/bin/pcscd 1.15 +PIDFILE=/run/pcscd/pcscd.pid 1.16 + 1.17 +case "$1" in 1.18 + start) 1.19 + if active_pidfile $PIDFILE pcscd ; then 1.20 + echo "$NAME already running." 1.21 + exit 1 1.22 + fi 1.23 + echo "Starting $DESC: $NAME... " 1.24 + mkdir -p $(dirname $PIDFILE) 1.25 + $DAEMON $PCSCD_OPTIONS ;; 1.26 + stop) 1.27 + if ! active_pidfile $PIDFILE pcscd ; then 1.28 + echo "$NAME is not running." 1.29 + exit 1 1.30 + fi 1.31 + echo -n "Stopping $DESC: $NAME... " 1.32 + kill $(cat $PIDFILE) 1.33 + rm $PIDFILE 1.34 + status ;; 1.35 + restart) 1.36 + $0 stop 1.37 + sleep 2 1.38 + $0 start ;; 1.39 + *) 1.40 + echo "" 1.41 + echo -e "\033[1mUsage:\033[0m /etc/init.d/$(basename $0) [start|stop|restart]" 1.42 + echo "" 1.43 + exit 1 ;; 1.44 +esac 1.45 + 1.46 +exit 0