wok-6.x annotate pcsc-lite/stuff/init.d/pcscd @ rev 20038

Add ipset, ipset-dev, iprange, firehol
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 24 19:59:19 2017 +0200 (2017-08-24)
parents 39cca942efb8
children
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
al@19159 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
al@19159 17 _ '%s is already running.' $NAME
pankso@13657 18 exit 1
pankso@13657 19 fi
al@19159 20 action 'Starting %s: %s...' "$DESC" $NAME
pankso@13657 21 mkdir -p $(dirname $PIDFILE)
al@19159 22 $DAEMON $PCSCD_OPTIONS
al@19159 23 status ;;
pankso@13657 24 stop)
pankso@13657 25 if ! active_pidfile $PIDFILE pcscd ; then
al@19159 26 _ '%s is not running.' $NAME
pankso@13657 27 exit 1
pankso@13657 28 fi
al@19159 29 action 'Stopping %s: %s...' "$DESC" $NAME
pankso@13657 30 kill $(cat $PIDFILE)
pascal@13668 31 [ -e $PIDFILE ] && rm -f $PIDFILE
pankso@13657 32 status ;;
pankso@13657 33 restart)
pankso@13657 34 $0 stop
pankso@13657 35 sleep 2
pankso@13657 36 $0 start ;;
pankso@13657 37 *)
al@19159 38 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
al@19159 39 newline
pankso@13657 40 exit 1 ;;
pankso@13657 41 esac
pankso@13657 42
pankso@13657 43 exit 0