rlgwebd/initscript
John "Elwin" Edwards 3b00718e59 Add an uninstall target to the Makefile.
Also a fix to the install target, and the initscript.
2016-01-14 21:30:14 -05:00

25 lines
382 B
Bash

#!/bin/sh
NODE_PATH=/usr/lib/node_modules
LOGFILE=/var/log/rlgwebd.log
CTLSOCKET=/var/run/rlgwebd.sock
RLGWEBDJS=/usr/local/bin/rlgwebd
export NODE_PATH
if [ $UID != 0 ]
then
echo "$0 needs to run as root." >&2
exit 1
fi
if [ $# -gt 0 ] && [ $1 = stop ]
then
socat "EXEC:echo quit" "$CTLSOCKET"
else
# Start
setsid node "$RLGWEBDJS" </dev/null &>>$LOGFILE &
fi
exit