wok-current annotate pcsc-lite/stuff/init.d/pcscd @ rev 16245

grisbi: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Apr 03 09:22:13 2014 +0000 (2014-04-03)
parents e509bd507650
children 7f188676b59c
rev   line source
pankso@13657 1 #!/bin/sh
pankso@13657 2 # /etc/init.d/pcscd: Start, stop and restart pcsc-lite daemon on SliTaz,
pankso@13657 3 # at boot time or with the command line. Daemons options are configured
pankso@13657 4 # with /etc/daemons.conf
pankso@13657 5 #
pankso@13657 6 . /etc/init.d/rc.functions
pankso@13657 7 . /etc/daemons.conf
pankso@13657 8
pankso@13657 9 NAME=Pcscd
pankso@13657 10 DESC="PC/SC smart card daemon"
pascal@13668 11 DAEMON=/usr/sbin/pcscd
pankso@13657 12 PIDFILE=/run/pcscd/pcscd.pid
pankso@13657 13
pankso@13657 14 case "$1" in
pankso@13657 15 start)
pankso@13657 16 if active_pidfile $PIDFILE pcscd ; then
pankso@13657 17 echo "$NAME already running."
pankso@13657 18 exit 1
pankso@13657 19 fi
pankso@13657 20 echo "Starting $DESC: $NAME... "
pankso@13657 21 mkdir -p $(dirname $PIDFILE)
pankso@13657 22 $DAEMON $PCSCD_OPTIONS ;;
pankso@13657 23 stop)
pankso@13657 24 if ! active_pidfile $PIDFILE pcscd ; then
pankso@13657 25 echo "$NAME is not running."
pankso@13657 26 exit 1
pankso@13657 27 fi
pankso@13657 28 echo -n "Stopping $DESC: $NAME... "
pankso@13657 29 kill $(cat $PIDFILE)
pascal@13668 30 [ -e $PIDFILE ] && rm -f $PIDFILE
pankso@13657 31 status ;;
pankso@13657 32 restart)
pankso@13657 33 $0 stop
pankso@13657 34 sleep 2
pankso@13657 35 $0 start ;;
pankso@13657 36 *)
pankso@13657 37 echo ""
pankso@13657 38 echo -e "\033[1mUsage:\033[0m /etc/init.d/$(basename $0) [start|stop|restart]"
pankso@13657 39 echo ""
pankso@13657 40 exit 1 ;;
pankso@13657 41 esac
pankso@13657 42
pankso@13657 43 exit 0