rename sfa-server.py into sfa-start.py
[sfa.git] / sfa / init.d / sfa
index b3b041c..08975dc 100755 (executable)
@@ -2,13 +2,11 @@
 #
 # sfa   Wraps PLCAPI into the SFA compliant API
 #
-# chkconfig: 2345 5 99
+# hopefully right after plc
+# chkconfig: 2345 61 39
 #
 # description:   Wraps PLCAPI into the SFA compliant API
 #
-# $Id$
-# $URL$
-#
 
 # Source config
 [ -f /etc/sfa/sfa_config ] && . /etc/sfa/sfa_config
@@ -63,28 +61,35 @@ start() {
     
     reload
 
-    if [ "$SFA_REGISTRY_ENABLED" ]; then
-        action $"SFA Registry" daemon /usr/bin/sfa-server.py -r -d $OPTIONS
+    # install peer certs
+    action $"SFA installing peer certs" daemon /usr/bin/sfa-start.py -t -d $OPTIONS 
+
+    if [ "$SFA_REGISTRY_ENABLED" -eq 1 ]; then
+        action $"SFA Registry" daemon /usr/bin/sfa-start.py -r -d $OPTIONS
     fi
 
-    if [ "$SFA_AGGREGATE_ENABLED" ]; then
-        action $"SFA Aggregate" daemon /usr/bin/sfa-server.py -a -d $OPTIONS
+    if [ "$SFA_AGGREGATE_ENABLED" -eq 1 ]; then
+        action $"SFA Aggregate" daemon /usr/bin/sfa-start.py -a -d $OPTIONS
     fi
         
-    if [ "$SFA_SM_ENABLED" ]; then
-        action "SFA SliceMgr" daemon /usr/bin/sfa-server.py -s -d $OPTIONS
+    if [ "$SFA_SM_ENABLED" -eq 1 ]; then
+        action "SFA SliceMgr" daemon /usr/bin/sfa-start.py -s -d $OPTIONS
+    fi
+
+    if [ "$SFA_FLASHPOLICY_ENABLED" -eq 1 ]; then
+        action "Flash Policy Server" daemon /usr/bin/sfa_flashpolicy.py --file="$SFA_FLASHPOLICY_CONFIG_FILE" --port=$SFA_FLASHPOLICY_PORT -d
     fi
 
     RETVAL=$?
-    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa
+    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa-start.py
 
 }
 
 stop() {
-    action $"Shutting down SFA" killproc sfa-server.py
+    action $"Shutting down SFA" killproc sfa-start.py
     RETVAL=$?
 
-    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa
+    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa-start.py
 }
 
 
@@ -94,13 +99,13 @@ case "$1" in
     reload) reload force ;;
     restart) stop; start ;;
     condrestart)
-       if [ -f /var/lock/subsys/sfa ]; then
+       if [ -f /var/lock/subsys/sfa-start.py ]; then
             stop
             start
        fi
        ;;
     status)
-       status sfa
+       status sfa-start.py
        RETVAL=$?
        ;;
     *)