Skip to content

Commit

Permalink
(Dirty) fixed restart on crash
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-chassaigne committed Sep 26, 2016
1 parent 55a2e7c commit a140a31
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions share/run.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a140a31

Please sign in to comment.