]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite-pcscd.init
- updated to 1.4.0
[packages/pcsc-lite.git] / pcsc-lite-pcscd.init
1 #!/bin/sh
2 #
3 # pcscd         PC/SC Smartcard daemon
4 #
5 # chkconfig:    2345 12 88
6 #
7 # description: The PC/SC smart card daemon is a resource manager for the \
8 #              PC/SC lite and Musclecard frameworks.  It coordinates \
9 #              communications with smart card readers, smart cards, and \
10 #              cryptographic tokens that are connected to the system.
11 #
12 # processname: pcscd
13 # config:      /etc/reader.conf
14 #
15 # $Id$
16
17
18 # Source function library
19 . /etc/rc.d/init.d/functions
20
21 umask 077
22
23 # Set defaults
24 LOGGING="yes"
25
26 # Get service config - may override defaults
27 [ -f /etc/sysconfig/pcscd ] && . /etc/sysconfig/pcscd
28
29 if is_yes "${LOGGING}"; then
30         LOGOPT="-d"
31 else
32         LOGOPT=""
33 fi
34
35 RETVAL=0
36 # See how we were called.
37 case "$1" in
38   start)
39         # Check if the service is already running?
40         if [ ! -f /var/lock/subsys/pcscd ]; then
41                 msg_starting pcscd
42                 /usr/sbin/update-reader.conf && daemon pcscd $LOGOPT
43                 RETVAL=$?
44                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd
45         else
46                 msg_already_running pcscd
47         fi
48         ;;
49   stop)
50         # Stop daemons.
51         if [ -f /var/lock/subsys/pcscd ]; then
52                 msg_stopping pcscd
53                 killproc pcscd
54                 rm -f /var/lock/subsys/pcscd
55         else
56                 msg_not_running pcscd
57         fi
58         ;;
59   restart|force-reload)
60         # pcscd doesn't support reloading on HUP
61         $0 stop
62         $0 start
63         exit $?
64         ;;
65   status)
66         status pcscd
67         exit $?
68         ;;
69   *)
70         msg_usage "$0 {start|stop|restart|force-reload|status}"
71         exit 3
72 esac
73
74 exit $RETVAL
75
76 # This must be last line !
77 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.072785 seconds and 3 git commands to generate.