wok-6.x view 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 source
1 #!/bin/sh
2 # /etc/init.d/pcscd: Start, stop and restart pcsc-lite daemon on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=Pcscd
10 DESC="PC/SC smart card daemon"
11 DAEMON=/usr/bin/pcscd
12 PIDFILE=/run/pcscd/pcscd.pid
14 case "$1" in
15 start)
16 if active_pidfile $PIDFILE pcscd ; then
17 echo "$NAME already running."
18 exit 1
19 fi
20 echo "Starting $DESC: $NAME... "
21 mkdir -p $(dirname $PIDFILE)
22 $DAEMON $PCSCD_OPTIONS ;;
23 stop)
24 if ! active_pidfile $PIDFILE pcscd ; then
25 echo "$NAME is not running."
26 exit 1
27 fi
28 echo -n "Stopping $DESC: $NAME... "
29 kill $(cat $PIDFILE)
30 rm $PIDFILE
31 status ;;
32 restart)
33 $0 stop
34 sleep 2
35 $0 start ;;
36 *)
37 echo ""
38 echo -e "\033[1mUsage:\033[0m /etc/init.d/$(basename $0) [start|stop|restart]"
39 echo ""
40 exit 1 ;;
41 esac
43 exit 0