aboutsummaryrefslogtreecommitdiff
path: root/init.sh
diff options
context:
space:
mode:
authorJoel Kronqvist <work.joelkronqvist@gmail.com>2022-10-25 18:57:32 +0300
committerJoel Kronqvist <work.joelkronqvist@gmail.com>2022-10-25 18:57:32 +0300
commitbd8e36aec2c6a78594c34066edc34b309cac2e0c (patch)
treeb1a44c2ee85340a115c3dc683c8f02f64a1a119e /init.sh
parent569fe38f54b21d9b7de5a8b48cbf14987383281d (diff)
downloadLYLLRuoka-bd8e36aec2c6a78594c34066edc34b309cac2e0c.tar.gz
LYLLRuoka-bd8e36aec2c6a78594c34066edc34b309cac2e0c.zip
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.
Diffstat (limited to 'init.sh')
-rwxr-xr-xinit.sh19
1 files changed, 10 insertions, 9 deletions
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