Checking in changes made in-place on the server to be merged
[oweals/finalsclub.git] / start
1 #!/bin/bash
2
3 # Start Script for running app.js and Etherpad-lite
4
5 # Kill all node instances
6 killall node
7
8 # Set Env. Vars.
9 export NODE_PATH=/home/risci_atom/FinalsClub/etherpad-lite/node_modules:$NODE_PATH
10 export MONGO_HOST_URI=mongodb://localhost/fc
11 export MONGO_HOST=localhost
12 export SERVER_HOST=www.finalsclub.org
13 export SERVER_PORT=80
14 export NODE_ENV=production
15
16
17 ps waux | grep node | grep -v grep
18
19 echo "starting ..."
20
21 cd etherpad-lite/node
22 forever server.js &> log.txt &
23 cd ../../
24 if [ "$(id -u)" != "0" ]; then
25         ## note: start as root, pass env vars to sudo param, this app will downgrade itself onc$
26         sudo -E forever app.js &> log.txt &
27 else
28         forever app.js &> log.txt &
29 fi