From a140a313bed283c5b1b636c48ef43feddefa9172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20CHASSAIGNE?= Date: Mon, 26 Sep 2016 07:39:18 +0000 Subject: [PATCH] (Dirty) fixed restart on crash --- share/run.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/share/run.sh b/share/run.sh index 5585313..3352b99 100644 --- a/share/run.sh +++ b/share/run.sh @@ -1,9 +1,20 @@ #!/bin/sh -# Run the server in an infinite loop - LD_LIBRARY_PATH=:/usr/local/lib/arm-linux-gnueabihf/ export LD_LIBRARY_PATH +PRG=be-server SCRIPT=$(dirname $(readlink -f "$0")) -while true; do $SCRIPT/be-server $*; done + +while true +do + ps cax | grep $PRG > /dev/null + if [ $? -eq 0 ]; then + echo "Server is running." + else + echo "Server is not running." + $SCRIPT/$PRG $* & + fi + + sleep 2 +done