Skip to content

Instantly share code, notes, and snippets.

@fritz-gerneth
Last active December 14, 2015 09:59
Show Gist options
  • Save fritz-gerneth/5068532 to your computer and use it in GitHub Desktop.
Save fritz-gerneth/5068532 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
cd /home/meteor/xxx
export MONGO_URL='mongodb://meteor:xxxx@localhost:27017/xxx-core'
export ROOT_URL='http://xxx.xxx.de'
export PORT=20000
export MAIL_URL='jenkins:[email protected]:25'
function start_app {
NODE_ENV=production nohup "node" "/home/meteor/xxx/main.js" 1>>"/home/meteor/xxx/log/xxx.log" 2>&1 &
echo $! > "/home/meteor/xxx/bin/innoaccel.pid"
}
function stop_app {
kill `cat /home/meteor/xxx/bin/xxx.pid`
}
case $1 in
start)
start_app ;;
stop)
stop_app ;;
restart)
stop_app
start_app
;;
*)
echo "Usage: xxx {start|stop|restart}" ;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment