diff options
author | Joel Kronqvist <work.joelkronqvist@gmail.com> | 2022-10-17 19:43:07 +0300 |
---|---|---|
committer | Joel Kronqvist <work.joelkronqvist@gmail.com> | 2022-10-17 19:43:07 +0300 |
commit | 0f8dcba6fe350ffb74331cb636046c30e784ca8d (patch) | |
tree | 5e059f0c608c1d01cb0930d8f9c49ba7b2a64768 | |
parent | 22a4830bb09cbecf6c2e8e52601a4e821bddbe8e (diff) | |
download | LYLLRuoka-0f8dcba6fe350ffb74331cb636046c30e784ca8d.tar.gz LYLLRuoka-0f8dcba6fe350ffb74331cb636046c30e784ca8d.zip |
Added instructions to start server at reboot. Doesn't neccessarily work. Updated the init script. No server code updates for now.
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | init.sh | 25 |
2 files changed, 14 insertions, 16 deletions
@@ -126,10 +126,9 @@ You can make the server run automatically on reboot. This hasn't been tested, th Add to **roots** crontab (run `sudo crontab -e`): ``` -@reboot cd ["BASE DIRECTORY"]/LYLLRuoka && node server.js -# For example: -# @reboot cd /home/foobar/LYLLRuoka/LYLLRuoka && node server.js +@reboot BASE_DIR='["BASE_DIRECTORY"]' ["BASE_DIRECTORY"]/LYLLRuoka/init.sh ``` +For example: `@reboot BASE_DIR='/home/foobar/LYLLRuoka' /home/foobar/LYLLRuoka/LYLLRuoka/init.sh` # Adding cool data that isn't required for the server to run @@ -1,23 +1,22 @@ #!/bin/sh exec 1>>/tmp/slogs exec 2>>/tmp/slogs +echo "========" echo | date -echo "Init running" +echo "# Init running" -echo "Removing old packages..." -rm -rf $PATH_TO_LYLLRUOKA - -echo "Waiting for connection..." -while [ ! "$(ping 'www.github.com' -c 1)" ] -do +echo "# Waiting for connection..." +while ! ping 'example.org' -c 1; do sleep 5 done +echo "# Connected to internet!" -cd "${PATH_TO_LYLLRUOKA%%FoodJS}" - -echo "Cloning new packages..." -git clone "https://github.com/JoelHMikael/FoodJS.git" +echo "" -cd $PATH_TO_LYLLRUOKA -echo "Starting server..." +cd "$BASE_DIR/LYLLRuoka" +echo "# node server.js:" node server.js + +echo "========" +echo "" +echo "" |