Added daemonise scripts

master
Ringo Watanabe 6 years ago
parent 399236f7b5
commit b5d7bbbd62

@ -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)

@ -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
Loading…
Cancel
Save