Skip to content

Instantly share code, notes, and snippets.

@tomoyamkung
Created August 18, 2012 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomoyamkung/3384547 to your computer and use it in GitHub Desktop.
Save tomoyamkung/3384547 to your computer and use it in GitHub Desktop.
[MongoDB]MongoDB の起動・停止を実行するスクリプト
#!/bin/sh
if [ "start" = "$1" ] ; then
cd /cygdrive/c/mongodb/bin
./mongod.exe --dbpath=../data --auth > /dev/null &
elif [ "stop" = "$1" ] ; then
ps ax | grep '/bin/mongod' | awk '{print $1}' | xargs kill -9
else
echo "Usage: run-mongo.sh start / run-mongo.sh stop"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment