.zshrc
history
HISTFILE=~/.zsh_history
HISTSIZE=6000000
SAVEHIST=6000000
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
confitional expression
case
# ! /bin/zsh
_APP_PATH=~/program/angularjs/logging
case "$1" in
'start')
ps aux | grep mongod 2>&1 > /dev/null
if [ $? -ne 0 ]; then
#/usr/local/bin/mongod
mongod --fork --quiet --dbpath /usr/local/var/mongodb --logpath /usr/local/var/mongodb/mongod.log
else
echo "mongod process already up."
fi
${_APP_PATH}/node_modules/forever/bin/forever start ${_APP_PATH}/app.js
;;
'stop')
${_APP_PATH}/node_modules/forever/bin/forever stop ${_APP_PATH}/app.js
;;
'restart')
${_APP_PATH}/node_modules/forever/bin/forever restart ${_APP_PATH}/app.js
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0