Created
March 29, 2019 16:45
-
-
Save mansurali901/fa10138c7a844812c5040a4e47f0a702 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
GoMongo () { | |
echo "Mongo is going to start" | |
mongod --config /etc/mongod.conf | |
echo "mongo is started" | |
} | |
StopMongo () { | |
echo "Mongo is going to stop" | |
mongod --shutdown --config /etc/mongod.conf | |
echo "mongo is stopped" | |
} | |
mongo_func () { | |
case $arg in | |
--start) | |
GoMongo | |
;; | |
--stop) | |
StopMongo | |
;; | |
*) | |
echo "Invalid Parameter please use below parameters | |
--start This option will start mongo | |
--stop This option will stop mongo | |
" | |
;; | |
esac | |
} | |
arg=$@ | |
if [ $# -le '1' ]; | |
then | |
echo "Mongo is starting " | |
mongo_func | |
else | |
echo "Invalid number of parameters" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment