wok view pcsc-lite/stuff/init.d/pcscd @ rev 24031

updated dialog (1.3_20190211 -> 1.3_20210324)
author Hans-G?nter Theisgen
date Tue Apr 06 13:52:57 2021 +0100 (2021-04-06)
parents 39cca942efb8
children
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 _ '%s is already running.' $NAME
18 exit 1
19 fi
20 action 'Starting %s: %s...' "$DESC" $NAME
21 mkdir -p $(dirname $PIDFILE)
22 $DAEMON $PCSCD_OPTIONS
23 status ;;
24 stop)
25 if ! active_pidfile $PIDFILE pcscd ; then
26 _ '%s is not running.' $NAME
27 exit 1
28 fi
29 action 'Stopping %s: %s...' "$DESC" $NAME
30 kill $(cat $PIDFILE)
31 [ -e $PIDFILE ] && rm -f $PIDFILE
32 status ;;
33 restart)
34 $0 stop
35 sleep 2
36 $0 start ;;
37 *)
38 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
39 newline
40 exit 1 ;;
41 esac
43 exit 0