1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-05-28 23:41:32 +00:00
8bitworkshop/scripts/docker/run.sh

21 lines
442 B
Bash
Raw Normal View History

2023-11-06 00:10:35 +00:00
#!/bin/sh
export _8BITWS_SERVER_ROOT=/app
cd "$_8BITWS_SERVER_ROOT"
while true; do
curl -O https://sehugg.github.io/8bitworkshop/gen/server/server.js
node server.js
# Check if the server crashed (exited with a non-zero status)
if [ $? -ne 0 ]; then
echo "Server crashed. Restarting in 10 seconds..."
sleep 10
else
# If the server exited normally (e.g., due to manual termination), exit the loop
break
fi
done