Last active
December 11, 2015 06:19
-
-
Save sghill/4558413 to your computer and use it in GitHub Desktop.
Detect in a shell script if you're running the right mongo version. Helpful when using mongodump, whose dump format changed to be unusable by earlier versions of mongod. see: http://docs.mongodb.org/manual/reference/mongodump/
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
if [[ -z $(mongo --version | grep '2.0.1') ]]; then | |
echo "expected 2.0.1, got $(mongo --version)" | |
exit 1 | |
else | |
echo "we have the right version" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment