Permalink
Browse files

Fix run script in case osfw is not configured with supervisorctl

  • Loading branch information...
root
root committed Oct 18, 2018
1 parent 8968254 commit 0c22e147bccc7bc70e94e9f0f9ee1f33d7e33588
Showing with 6 additions and 6 deletions.
  1. +6 −6 run.sh
12 run.sh
@@ -15,8 +15,8 @@ export LC_ALL="C.UTF-8"
export LANG="C.UTF-8"

if [ -z "$1" ]; then
RESULT=`supervisorctl pid osfw-sensor`
if [ "$RESULT" == 0 ]; then
RESULT=`supervisorctl pid osfw-sensor 2> /dev/null`
if [ "$RESULT" == 0 ] || [ -z "$RESULT" ]; then
RESULT=`find /var/run/screen -name "*.osfw-sensor" | wc -l | xargs`
if [ "$RESULT" == 0 ]; then
screen -dmS osfw-sensor python osfw.py daemon/sensor
@@ -26,8 +26,8 @@ if [ -z "$1" ]; then
else
echo "Error: osfw-sensor is already running from supervisor"
fi
RESULT=`supervisorctl pid osfw-syncfw`
if [ "$RESULT" == 0 ]; then
RESULT=`supervisorctl pid osfw-syncfw 2> /dev/null`
if [ "$RESULT" == 0 ] || [ -z "$RESULT" ]; then
RESULT=`find /var/run/screen -name "*.osfw-syncfw" | wc -l | xargs`
if [ "$RESULT" == 0 ]; then
screen -dmS osfw-syncfw python osfw.py daemon/syncfw
@@ -37,8 +37,8 @@ if [ -z "$1" ]; then
else
echo "Error: osfw-syncfw is already running from supervisor"
fi
RESULT=`supervisorctl pid osfw-webapp`
if [ "$RESULT" == 0 ]; then
RESULT=`supervisorctl pid osfw-webapp 2> /dev/null`
if [ "$RESULT" == 0 ] || [ -z "$RESULT" ]; then
RESULT=`find /var/run/screen -name "*.osfw-webapp" | wc -l | xargs`
if [ "$RESULT" == 0 ]; then
screen -dmS osfw-webapp python osfw.py webapp

0 comments on commit 0c22e14

Please sign in to comment.