#!/bin/bash
service atd start
service mongodb stop
redis-server --daemonize yes --loglevel verbose --logfile /monterossa/logs/redis.log
mongod --fork --logpath /monterossa/logs/mongod.log --dbpath /monterossa/db/
mongo < /mongo/mongoDemo.js
sleep 5
cd /monterossa/iarchiv-client && /usr/bin/npm i && npm i node-sass && /usr/bin/gulp release > /monterossa/logs/iarchiv-client.log
echo 'cd /monterossa/iarchiv-server && npm i  && /usr/bin/node index.js > /monterossa/logs/iarchiv-server.log ' | at now + 1 min
echo 'cd /monterossa/iarchiv-pdf-worker && npm i && /usr/bin/node index.js release > /monterossa/logs/iarchiv-pdf-worker.log ' | at now + 1 min
echo 'cd /monterossa/iarchiv-unified-storage && npm i && /usr/bin/gulp release --fs > /monterossa/logs/iarchiv-u-storage.log ' | at now + 1 min