--- /dev/null
+#!/bin/bash
+#
+# sfa Wraps PLCAPI into the SFA compliant API
+#
+# chkconfig: 2345 5 99
+#
+# description: Wraps PLCAPI into the SFA compliant API
+#
+
+# Source config
+. /etc/sfa/sfa_config
+
+# source function library
+. /etc/init.d/functions
+
+init_key() {
+ # if key doesnt exist use sfa_componenet_setup to get it
+ if [ ! -f /var/lib/sfa/server.key ]; then
+ /usr/bin/sfa_component_setup.py -k
+ fi
+}
+
+start() {
+ echo -n $"Starting SFA: "
+
+ if [ "$SFA_CM_ENABLED" ]; then
+ echo "Component Mgr"
+ # make sure server key (nodes private key) exists first
+ init_key
+ /usr/bin/sfa-start.py -c -d $OPTIONS
+ fi
+
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa
+
+}
+
+stop() {
+ echo -n $"Shutting down SFA: "
+ killproc sfa-start.py
+ RETVAL=$?
+
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa
+}
+
+
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/sfa ]; then
+ stop
+ start
+ fi
+ ;;
+ status)
+ status sfa
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
+