GENI_REGISTRY_ENABLE should be GENI_REGISTRY_ENABLED
[sfa.git] / geni / geniwrapper
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 #
11
12 # Source config
13 . /etc/geni/geni_config
14
15 # source function library
16 . /etc/init.d/functions
17
18
19 start() {
20         echo -n $"Starting GENIWrapper:  "
21
22         if [ "$GENI_REGISTRY_ENABLED" ]; then
23             echo "Registry"
24             daemon /usr/bin/plc.py -r -d $OPTIONS
25         fi
26
27         if [ "$GENI_AGGREGATE_ENABLED" ]; then
28             echo "Aggregate"
29             daemon /usr/bin/plc.py -a -d $OPTIONS
30         fi
31         
32         if [ "$GENI_SM_ENABLED" ]; then
33             echo "SliceMgr"
34             daemon /usr/bin/plc.py -s -d $OPTIONS
35         fi
36
37         RETVAL=$?
38         echo
39         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/geniwrapper
40
41 }
42
43 stop() {
44     echo -n $"Shutting down GENIWrapper: "
45     killproc plc.py
46     RETVAL=$?
47
48     echo
49     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/geniwrapper
50 }
51
52
53
54 case "$1" in
55   start)
56     start
57     ;;
58   stop)
59     stop
60     ;;
61   restart|reload)
62     stop
63     start
64     ;;
65   condrestart)
66     if [ -f /var/lock/subsys/geniwrapper ]; then
67         stop
68         start
69     fi
70     ;;
71   status)
72     status geniwrapper
73     RETVAL=$?
74     ;;
75   *)
76     echo $"Usage: $0 {start|stop|restart|condrestart|status}"
77     exit 1
78 esac
79
80 exit $RETVAL
81