view initscript @ 202:7f25bb89b59c

Move RLGWebD configuration options into a configuration file. On startup, rlgwebd now reads /etc/rlgwebd.conf. If the options for HTTPS are not found, it will only use HTTP.
author John "Elwin" Edwards
date Wed, 04 Jan 2017 20:28:29 -0500
parents 298a531776d6
children f06f2d1a5035
line wrap: on
line source

#!/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