use self.get_auth_info
[sfa.git] / sfa / init.d / sfa
1 #!/bin/bash
2 #
3 # geniwrapper   Wraps PLCAPI into the GENI compliant API
4 #
5 # chkconfig: 2345 5 99
6 #
7 # description:   Wraps PLCAPI into the GENI compliant API
8 #
9 # $Id$
10 # $URL$
11 #
12
13 # Source config
14 . /etc/sfa/sfa_config
15
16 # source function library
17 . /etc/init.d/functions
18
19
20 start() {
21         echo -n $"Starting GENIWrapper:  "
22
23         if [ "$GENI_REGISTRY_ENABLED" ]; then
24             echo "Registry"
25             daemon /usr/bin/sfa-server.py -r -d $OPTIONS
26         fi
27
28         if [ "$GENI_AGGREGATE_ENABLED" ]; then
29             echo "Aggregate"
30             daemon /usr/bin/sfa-server.py -a -d $OPTIONS
31         fi
32         
33         if [ "$GENI_SM_ENABLED" ]; then
34             echo "SliceMgr"
35             daemon /usr/bin/sfa-server.py -s -d $OPTIONS
36         fi
37
38         RETVAL=$?
39         echo
40         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/geniwrapper
41
42 }
43
44 stop() {
45     echo -n $"Shutting down GENIWrapper: "
46     killproc sfa-server.py
47     RETVAL=$?
48
49     echo
50     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/geniwrapper
51 }
52
53
54
55 case "$1" in
56   start)
57     start
58     ;;
59   stop)
60     stop
61     ;;
62   restart|reload)
63     stop
64     start
65     ;;
66   condrestart)
67     if [ -f /var/lock/subsys/geniwrapper ]; then
68         stop
69         start
70     fi
71     ;;
72   status)
73     status geniwrapper
74     RETVAL=$?
75     ;;
76   *)
77     echo $"Usage: $0 {start|stop|restart|condrestart|status}"
78     exit 1
79 esac
80
81 exit $RETVAL
82