start/stop stunnel
[cloudstore.git] / init.d / _start_stop
index 8018d2e..bec49ec 100755 (executable)
@@ -1,9 +1,16 @@
+BACKGROUND=1
+
 _start_stop() {
 
 case $1 in
        start)
-               cd /srv/cloudstore && ( $DAEMON 2>&1 ) > /tmp/$NAME.log &
-               echo $! > /tmp/$NAME.pid
+               cd /srv/cloudstore
+               if [ "$BACKGROUND" -eq 1 ] ; then
+                       ( $DAEMON 2>&1 ) > /tmp/$NAME.log &
+                       echo $! > /tmp/$NAME.pid
+               else
+                       $DAEMON
+               fi
                ;;
        stop)  
                kill `cat /tmp/$NAME.pid` ;;