Resolve "Wazuh"

This commit is contained in:
Steven Foerster
2021-04-22 02:40:26 +00:00
parent ed37b142ba
commit 42bd766346
13 changed files with 321 additions and 26 deletions
+29 -24
View File
@@ -2,38 +2,43 @@
set -e
SERVICE="$1"
MISTBORN_HOME="/opt/mistborn"
SERVICES="$1"
shift
export MISTBORN_HOME="/opt/mistborn"
export MISTBORN_SERVICE_FILE=${MISTBORN_HOME}/.envs/.production/.${SERVICE}
export MISTBORN_SERVICE_INIT=${MISTBORN_HOME}/scripts/services/${SERVICE}/init.sh
IFS=','
read -ra SERVICES_ARRAY <<< "${SERVICES}"
for SERVICE in "${SERVICES_ARRAY[@]}"; do
MISTBORN_SERVICE_FILE=${MISTBORN_HOME}/.envs/.production/.${SERVICE}
MISTBORN_SERVICE_INIT=${MISTBORN_HOME}/scripts/services/${SERVICE}/init.sh
# check and create file if needed
${MISTBORN_HOME}/scripts/env/check_env_file.sh ${SERVICE}
# check and create file if needed
${MISTBORN_HOME}/scripts/env/check_env_file.sh ${SERVICE}
# read in variables
set -a
source ${MISTBORN_HOME}/.env
# read in variables
set -a
source ${MISTBORN_HOME}/.env
if [[ -f "${MISTBORN_SERVICE_FILE}" ]]; then
echo "Loading service variables"
source ${MISTBORN_SERVICE_FILE}
else
echo "No service variables to load. Proceeding."
fi
set +a
if [[ -f "${MISTBORN_SERVICE_FILE}" ]]; then
echo "Loading service variables"
source ${MISTBORN_SERVICE_FILE}
else
echo "No service variables to load. Proceeding."
fi
set +a
# init script
if [[ -f "${MISTBORN_SERVICE_INIT}" ]]; then
echo "Running init script"
${MISTBORN_SERVICE_INIT}
else
echo "No init script. Proceeding."
fi
# init script
if [[ -f "${MISTBORN_SERVICE_INIT}" ]]; then
echo "Running init script"
${MISTBORN_SERVICE_INIT}
else
echo "No init script. Proceeding."
fi
done
# ensure base is up and listening
echo "Waiting for Mistborn-base to finish starting up..."
echo "Checking that Mistborn-base has finished starting up..."
while ! nc -z 10.2.3.1 5000; do
WAIT_TIME=$((5 + $RANDOM % 15))