Mercurial > hg > rlgwebd
annotate rlgwebd @ 158:9961a538c00e
rlgwebd.js: get rid of numerical game identifiers.
Games will be indentified by gamename/username pairs. This will allow
better interoperability with dgamelaunch.
Polling clients are no longer supported; the code remnants need to be
removed. The reaper() function will likely crash. Unexpectedly, the
WebSocket client still works well enough to play. Watching and listing
current games are probably broken.
author | John "Elwin" Edwards |
---|---|
date | Thu, 01 Jan 2015 15:56:22 -0500 |
parents | 1a156a7746a7 |
children | 5483d413a45b |
rev | line source |
---|---|
139 | 1 #!/bin/sh |
2 | |
141
1a156a7746a7
RLGWebD: use NODE_PATH to find modules.
John "Elwin" Edwards
parents:
139
diff
changeset
|
3 NODE_PATH=/usr/lib/node_modules |
139 | 4 LOGFILE=/var/local/rlgwebd/log |
5 CTLSOCKET=/var/local/rlgwebd/ctl | |
6 RLGWEBDJS=./rlgwebd.js | |
7 | |
141
1a156a7746a7
RLGWebD: use NODE_PATH to find modules.
John "Elwin" Edwards
parents:
139
diff
changeset
|
8 export NODE_PATH |
1a156a7746a7
RLGWebD: use NODE_PATH to find modules.
John "Elwin" Edwards
parents:
139
diff
changeset
|
9 |
139 | 10 if [ $UID != 0 ] |
11 then | |
12 echo "$0 needs to run as root." >&2 | |
13 exit 1 | |
14 fi | |
15 | |
16 if [ $# -gt 0 ] && [ $1 = stop ] | |
17 then | |
18 socat "EXEC:echo quit" "$CTLSOCKET" | |
19 else | |
20 # Start | |
21 setsid node "$RLGWEBDJS" </dev/null &>>$LOGFILE & | |
22 fi | |
23 | |
24 exit | |
25 |