Last active
December 14, 2015 09:59
-
-
Save fritz-gerneth/5068532 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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