Skip to content

Instantly share code, notes, and snippets.

@luchaninov
Last active August 29, 2015 14:03
Show Gist options
  • Save luchaninov/9b23c9793d9eca6f15b6 to your computer and use it in GitHub Desktop.
Save luchaninov/9b23c9793d9eca6f15b6 to your computer and use it in GitHub Desktop.
Check if Mongo is working
#!/bin/bash
TEST="TEST PASSED"
RESULT="`mongo --quiet --eval \"print('${TEST}');\" 2> /dev/null | grep --color=never \"${TEST}\"`"
if [[ "${RESULT}" == "${TEST}" ]]; then
echo "Mongo is working"
else
echo "Mongo is not working"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment