From 8b5acf69177a2102d25f79fd24ff8bc2a6c010f8 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 18 Dec 2022 11:23:08 +0100 Subject: [PATCH] Bastion: pritify entrypoint --- bot/bastion/entrypoint.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/bot/bastion/entrypoint.sh b/bot/bastion/entrypoint.sh index c747df6..e898b6d 100644 --- a/bot/bastion/entrypoint.sh +++ b/bot/bastion/entrypoint.sh @@ -1,4 +1,21 @@ #!/bin/bash +#Variables +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +clear +#show versions +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}BastionBot Installation${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}MongoDB Version:${NC} " && mongod --version +echo -e "${YELLOW}NodeJS Version:${NC} " && node -v +echo -e "${YELLOW}Python Version:${NC} " && python3 --version +echo -e "${BLUE}-------------------------------------------------${NC}" + cd /home/container # Set environment variable that holds the Internal Docker IP @@ -7,12 +24,18 @@ export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) -echo -e ":/home/container$ ${MODIFIED_STARTUP}" +echo -e "${YELLOW}:/home/container${NC} ${MODIFIED_STARTUP}" # start mongo +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}starting MongoDB...${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" mongod --fork --dbpath /home/container/mongodb/ --port 27017 --logpath /home/container/mongod.log --logRotate reopen --logappend && until nc -z -v -w5 127.0.0.1 27017; do echo 'Waiting for mongodb connection...'; sleep 5; done # Run the Server +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}BastionBot starting...${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" eval ${MODIFIED_STARTUP} # stop mongo