Created
January 23, 2020 14:53
-
-
Save sarjarapu/d57cf7d7a5dc706dbe0e1c0c779cc5e4 to your computer and use it in GitHub Desktop.
A bash script to create LOCAL_KEY and start the MongoDB shell
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
# Generate 96 char local key. save it don't loose it | |
LOCAL_KEY=$(openssl rand -hex 50 | head -c 96 | base64 | tr -d '\n') | |
echo $LOCAL_KEY | |
# YzRiY2Y3ZGUzNDgxYzQwNzliMGEzMDI2YjU0ODkwMjQ5ZTNmMWFkZDdiZGUzMDc5ZTVlMWYxNjBlMDM5MGJmMjhmOWIyODdlMjU3MjA1M2ZmZjdiZDViYWE1Y2Q1OTRi | |
# Start the v4.2 client. Note that you are not connecting to server yet | |
${MONGO_BIN}/mongo --shell --nodb --eval "var LOCAL_KEY = '$LOCAL_KEY' " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment