diff --git a/error.log b/error.log new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/error.log @@ -0,0 +1 @@ + diff --git a/maintain/start.sh b/maintain/start.sh new file mode 100755 index 0000000..3d84d0b --- /dev/null +++ b/maintain/start.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f "rtbwn.pid" ]; then + echo "Server is already active" + exit +fi + +if [ ! -f "main.js" ]; then + echo "Run this script from the server directory" + exit +fi + +echo "" > error.log +node main.js 1>/dev/null 2>>error.log & +echo $! > rtbwn.pid + +echo Daemon started at PID $(cat rtbwn.pid) diff --git a/maintain/stop.sh b/maintain/stop.sh new file mode 100755 index 0000000..c4b7a8f --- /dev/null +++ b/maintain/stop.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ -f rtbwn.pid ]; then + kill $(cat rtbwn.pid) + rm rtbwn.pid +else + echo "Server is not active, or you are not in the server directory" +fi