]>
Commit | Line | Data |
---|---|---|
f588025c JB |
1 | #!/bin/sh |
2 | # | |
3 | # pcscd PC/SC Smartcard daemon | |
4 | # | |
ab856a2b | 5 | # chkconfig: 2345 12 88 |
f588025c JB |
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 | ||
bd7842e0 | 27 | RETVAL=0 |
f588025c JB |
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 | |
f588025c | 41 | fi |
ab856a2b | 42 | ;; |
f588025c | 43 | stop) |
ab856a2b | 44 | # Stop daemons. |
45 | # show "Stopping %s service" pcscd | |
f588025c JB |
46 | if [ -f /var/lock/subsys/pcscd ]; then |
47 | msg_stopping pcscd | |
48 | killproc pcscd | |
f588025c JB |
49 | rm -f /var/lock/subsys/pcscd |
50 | else | |
51 | # show "%s service is not running." pcscd | |
52 | msg_not_running pcscd | |
f588025c | 53 | fi |
ab856a2b | 54 | ;; |
bd7842e0 | 55 | restart|force-reload) |
f588025c | 56 | # pcscd doesn't support reloading on HUP |
ab856a2b | 57 | $0 stop |
f588025c | 58 | $0 start |
bd7842e0 | 59 | exit $? |
ab856a2b | 60 | ;; |
f588025c JB |
61 | status) |
62 | status pcscd | |
bd7842e0 | 63 | exit $? |
ab856a2b | 64 | ;; |
f588025c | 65 | *) |
bd7842e0 | 66 | # show "Usage: %s {start|stop|restart|force-reload|status}" |
67 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
68 | exit 3 | |
f588025c JB |
69 | esac |
70 | ||
71 | exit $RETVAL | |
72 | ||
73 | # This must be last line ! | |
74 | # vi:syntax=sh:tw=78:ts=8:sw=4 |