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