also updated these scripts to s3
chmod a+rx *
chmod uo-w *
cp -f * /usr/local/bin
- echo "/usr/local/bin &> /var/log/mongod.log &" >> /etc/rc.local
mkdir -p /data/db
/usr/local/bin/mongod -v --rest --replSet finalsclubset &> /var/log/mongod.log &
# sudo /usr/local/haproxy/haproxy -f /usr/local/haproxy/haproxy.cfg -p /var/run/haproxy.pid &
+## init the reboot-restart.sh script, but don't run it.
+cd ~
+wget https://s3.amazonaws.com/finalsclub.org/reboot-restart.sh
+chmod 755 reboot-restart.sh
+echo "/root/reboot-restart.sh &> /var/log/fc-reboot-restart.log.txt &" >> /etc/rc.local
+
curl https://s3.amazonaws.com/finalsclub.org/start.sh | sudo -u ec2-user sh
--- /dev/null
+#!/bin/bash
+
+export PATH="/usr/local/bin:$PATH"
+
+## this script assumes it is running as root
+rm /data/db/mongod.lock
+/usr/local/bin/mongod -v --rest --replSet finalsclubset &> /var/log/mongod.log &
+
+## optional, if arbiter db is running on this machine
+## rm /data/arbiterdb/mongod.lock
+## /usr/local/bin/mongod -v --dbpath /data/arbiterdb --port 27021 --rest --replSet finalsclubset &> /var/log/mongod-arbiter.log &
+
+pushd .
+cd /home/ec2-user/fc
+cat restart | sudo -u ec2-user sh
+popd
+
#!/bin/bash
-cd ~
-
export PATH="/usr/local/bin:$PATH"
+cd ~
rm -rf bc
git clone git@github.com:finalsclubdev/bc
cd ~/bc
npm install express-messages
npm install jade
-
+cd ~
rm -rf fc
git clone git@github.com:finalsclubdev/FinalsClub.git
ln -sf FinalsClub fc
## start the server
cd ~/fc
-./restart.sh
+./restart