]> git.pld-linux.org Git - packages/openct.git/blob - openct.init
- added new download URL
[packages/openct.git] / openct.init
1 #!/bin/sh
2 #
3 # openct        OpenCT card service
4 #
5 # chkconfig:    2345 37 65
6 #
7 # description:  OpenCT is a library for accessing smart card terminals.
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 start() {
13         if [ ! -f /var/lock/subsys/openct ]; then
14                 show "Initializing OpenCT status"
15                 busy
16                 openct-control init
17                 RETVAL=$?
18                 if [ $RETVAL -eq 0 ]; then
19                         ok
20                         touch /var/lock/subsys/openct
21                 else
22                         fail
23                 fi
24         else
25                 msg_already_running openct
26         fi
27 }
28
29 stop() {
30         if [ -f /var/lock/subsys/openct ]; then
31                 show "Shutting down OpenCT"
32                 busy
33                 openct-control shutdown >/dev/null
34                 ok
35                 rm -f /var/lock/subsys/openct /var/run/openct/* >/dev/null 2>&1
36         else
37                 msg_not_running openct
38         fi
39 }
40
41 condrestart() {
42         if [ -f /var/lock/subsys/openct ]; then
43                 stop
44                 start
45         else
46                 msg_not_running openct
47                 RETVAL=$1
48         fi
49 }
50
51 RETVAL=0
52 # See how we were called.
53 case "$1" in
54   start)
55         start
56         ;;
57   stop)
58         stop
59         ;;
60   restart)
61         stop
62         start
63         ;;
64   try-restart)
65         condrestart 0
66         ;;
67   force-reload)
68         condrestart 7
69         ;;
70   status)
71         status openct
72         RETVAL=$?
73         ;;
74   *)
75         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
76         exit 3
77         ;;
78 esac
79
80 exit $RETVAL
This page took 0.138314 seconds and 3 git commands to generate.