]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - pcsc-lite-pcscd.init
- distfiles don't support https, changed Source0 to http
[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 RETVAL=0
28 # See how we were called.
29 case "$1" in
30   start)
31         # Check if the service is already running?
32         if [ ! -f /var/lock/subsys/pcscd ]; then
33                 # show "Starting %s service" pcscd
34                 msg_starting pcscd
35                 daemon pcscd $LOGOPT
36                 RETVAL=$?
37                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd
38         else
39                 # show "%s service is already running." pcscd
40                 msg_already_running pcscd
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                 rm -f /var/lock/subsys/pcscd
50         else
51                 # show "%s service is not running." pcscd
52                 msg_not_running pcscd
53         fi      
54         ;;
55   restart|force-reload)
56         # pcscd doesn't support reloading on HUP
57         $0 stop
58         $0 start
59         exit $?
60         ;;
61   status)
62         status pcscd
63         exit $?
64         ;;
65   *)
66         # show "Usage: %s {start|stop|restart|force-reload|status}"
67         msg_usage "$0 {start|stop|restart|force-reload|status}"
68         exit 3
69 esac
70
71 exit $RETVAL
72
73 # This must be last line !
74 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.085607 seconds and 3 git commands to generate.