Newer
Older
#
# Start diaspora websocket and main services
#
# Is someone listening on the port already? (ipv4 only test ?)
PORT=3000
while getopts ":p:" OPTION
do
then
PORT=$OPTARG
fi
done
services=$( netstat -nl | grep ":$PORT[ \t]")
test -n "$services" && {
echo " $services"
# Check if Mongo is running
if ! ps ax | grep -v grep | grep mongod >/dev/null
then
echo "Mongod not started"
else
mkdir -p -v log/thin/
test -w public -a ! -e public/source.tar.gz &&
tar czf public/source.tar.gz --exclude='source.tar.gz' -X .gitignore *
test -e public/source.tar.gz || {
echo "Can't find, or even create, public/source.tar.gz. Giving up"
bundle exec ruby ./script/websocket_server.rb&
bundle exec thin start $@
fi