From 318f4bb7719135bba2026780d62ef6bbb43c5ca2 Mon Sep 17 00:00:00 2001 From: Mumshad Mannambeth Date: Wed, 12 Jul 2017 13:56:58 -0400 Subject: [PATCH] Update startup script to skip starting local mongodb if MONGODB_URI is provided --- helpers/startup.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/helpers/startup.sh b/helpers/startup.sh index 9d14b24..5b01f0f 100644 --- a/helpers/startup.sh +++ b/helpers/startup.sh @@ -20,11 +20,17 @@ if [[ ${MOUNT_S3} = "True" ]]; yas3fs s3://${S3_PATH} /opt/ansible-projects -f & fi -echo -e "${COLOR_GREEN}-----------------------------------------------------" -echo -e " Start MONGODB Service" -echo -e "-----------------------------------------------------${NC}" # Start MongoDB database in the background -mongod & +if [[ ${MONGODB_URI} == *"localhost"* || ${MONGODB_URI} == "" ]] + then + echo -e "${COLOR_GREEN}-----------------------------------------------------" + echo -e " Start MONGODB Service" + echo -e "-----------------------------------------------------${NC}" + + mongod & + else + echo -e " -------------- Not Starting MONGODB Service -----------" +fi echo -e "${COLOR_GREEN}-----------------------------------------------------" echo -e " Start Web Server"