From bd8e36aec2c6a78594c34066edc34b309cac2e0c Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Tue, 25 Oct 2022 18:57:32 +0300 Subject: Fixed shift parsing when no teacher is supplied. Made server be run in a loop in init.sh to bring it up again if it crashes. --- init.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'init.sh') diff --git a/init.sh b/init.sh index 2fc915d..5fb171f 100755 --- a/init.sh +++ b/init.sh @@ -1,8 +1,7 @@ #!/bin/sh -exec 1>>/tmp/slogs -exec 2>>/tmp/slogs -echo "========" -echo | date +exec 1>>/var/slogs +exec 2>>/var/slogs +echo "" echo "# Init running" echo "# Waiting for connection..." @@ -22,9 +21,11 @@ echo "# Database seems to be available (ignore error messages above)" echo "" cd "$BASE_DIR/LYLLRuoka" -echo "# node server.js:" -node server.js +while echo "# node server.js:"; do + node server.js -echo "========" -echo "" -echo "" + # Sleep below, so that the loop can't cause too big a load to the server, if the server terminates very fast. + sleep 5 + echo "SERVER TERMINATED!" + echo "--------" +done -- cgit v1.2.3