OSDN Git Service

Fixed and cleanup condition(LT/LE/GT/GE) check in FSM
[openpts/openpts.git] / dist / fedora.initrd.ptsc
1 #!/bin/bash
2 #
3 # Init file for the OpenPTS TCG Platform Trust Services collector
4 #
5 # chkconfig: - 91 9
6 # description: OpenPTS Collector
7 #
8 # processname: ptscd
9 # config: /etc/ptscd.conf
10 # pidfile: /var/run/ptscd.pid
11 #
12 #
13
14 prog="ptsc"
15
16 # source function library
17 . /etc/rc.d/init.d/functions
18
19 # Allow anyone to run status
20 if [ "$1" = "status" ] ; then
21         status $prog
22         RETVAL=$?
23         exit $RETVAL
24 fi
25
26 # Check that we are root ... so non-root users stop here
27 test $EUID = 0  ||  exit 4
28
29 RETVAL=0
30
31 # Some variables to make the below more readable
32 PTSC=/usr/sbin/ptsc
33 CONF_FILE=/etc/ptsc.conf
34
35 start()
36 {
37         test -x $PTSC || exit 5
38         #test -f /etc/ptsc.conf || exit 6
39         echo -n $"Starting $prog: "
40         $PTSC -s $OPTIONS start && success || failure
41         echo
42 }
43
44 init()
45 {
46         echo -n $"Initialize $prog: "
47         $PTSC -i start && success || failure
48         echo
49 }
50
51 update()
52 {
53         echo -n $"Update $prog: "
54         $PTSC -u start && success || failure
55         echo
56 }
57
58
59 case "$1" in
60         init)
61                 init
62                 ;;
63         start)
64                 start
65                 ;;
66         update)
67                 update
68                 ;;
69         *)
70                 echo $"Usage: $0 {init|start|update|status}"
71                 RETVAL=3
72 esac
73 exit $RETVAL
74
75
76 #