wok-current view pcsc-lite/stuff/init.d/pcscd @ rev 17265
efl: fix build.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Oct 22 22:35:43 2014 +0300 (2014-10-22) |
parents | e509bd507650 |
children | 7f188676b59c |
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/sbin/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 [ -e $PIDFILE ] && rm -f $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