]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite-pcscd.init
- init script for pcscd
[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:  daemon for pcsc-lite and musclecard framework
8 #
9 # $Id$
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Set defaults
16 LOGGING="yes"
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/pcscd ] && . /etc/sysconfig/pcscd
20
21 if is_yes "${LOGGING}"; then
22         LOGOPT="-d syslog"
23 else
24         LOGOPT=""
25 fi
26
27 # See how we were called.
28 case "$1" in
29   start)
30         # Check if the service is already running?
31         if [ ! -f /var/lock/subsys/pcscd ]; then
32                 # show "Starting %s service" pcscd
33                 msg_starting pcscd
34                 daemon pcscd $LOGOPT
35                 RETVAL=$?
36                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd
37         else
38                 # show "%s service is already running." pcscd
39                 msg_already_running pcscd
40                 exit 1
41         fi
42         ;;
43   stop)
44         # Stop daemons.
45         # show "Stopping %s service" pcscd
46         if [ -f /var/lock/subsys/pcscd ]; then
47                 msg_stopping pcscd
48                 killproc pcscd
49                 RETVAL=$?
50                 rm -f /var/lock/subsys/pcscd
51         else
52                 # show "%s service is not running." pcscd
53                 msg_not_running pcscd
54                 exit 1
55         fi      
56         ;;
57   restart|reload|force-reload)
58         # pcscd doesn't support reloading on HUP
59         $0 stop
60         $0 start
61         ;;
62   status)
63         status pcscd
64         RETVAL=$?
65         ;;
66   *)
67         # show "Usage: %s {start|stop|status|restart|reload|force-reload}" $0
68         msg_usage "$0 {start|stop|status|restart|reload|force-reload}"
69         exit 1
70 esac
71
72 exit $RETVAL
73
74 # This must be last line !
75 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.062816 seconds and 3 git commands to generate.