#!/bin/bash set -e SERVICE="$1" export MISTBORN_HOME=/opt/mistborn # read in global variables set -a source ${MISTBORN_HOME}/.env source ${MISTBORN_HOME}/.envs/.production/.django source ${MISTBORN_HOME}/.envs/.production/.postgres source ${MISTBORN_HOME}/.envs/.production/.pihole set +a export SERVICE_ENV_INSTALLER="${MISTBORN_HOME}/scripts/subinstallers/extra/${SERVICE}.sh" export SERVICE_ENV_FILE="${MISTBORN_HOME}/.envs/.production/.${SERVICE}" if [[ -f "${SERVICE_ENV_INSTALLER}" ]]; then if [[ -f "${SERVICE_ENV_FILE}" ]]; then echo "Environment file already exists." else echo "Creating environment file" source $SERVICE_ENV_INSTALLER $SERVICE_ENV_FILE fi else echo "No subinstaller found." fi