Skip to content

Commit

Permalink
Fix run script in case osfw is not configured with supervisorctl
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 18, 2018
1 parent 8968254 commit 0c22e14
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0c22e14

Please sign in to comment.