verbose vars

This commit is contained in:
David Abutbul 2022-01-29 21:24:20 +02:00 committed by GitHub
parent d46adfc743
commit 39efa79743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -2,25 +2,25 @@
set -e set -e
# Set some vars # Set some vars
PRE_POP_VOLS=("config" "mods" "art") # These are folders which contain runtime needed files, and need to be represented in the host PRE_POPULATED_VOLUMES=("config" "mods" "art") # These are folders which contain runtime needed files, and need to be represented in the host
BBS_ROOT=/enigma-bbs # Install location BBS_ROOT_DIR=/enigma-bbs # Install location
BBS_STG_P=/enigma-bbs-pre # Staging location for pre populated volumes (PRE_POP_VOLS) BBS_STAGING_PATH=/enigma-bbs-pre # Staging location for pre populated volumes (PRE_POPULATED_VOLUMES)
CONFIG_NAME=config.hjson # This is the default name, this script is intended for easy get-go - make changes as needed CONFIG_NAME=config.hjson # This is the default name, this script is intended for easy get-go - make changes as needed
# Setup happens when there is no existing config file # Setup happens when there is no existing config file
if [[ ! -f $BBS_ROOT/config/$CONFIG_NAME ]]; then if [[ ! -f $BBS_ROOT_DIR/config/$CONFIG_NAME ]]; then
for DIR in "${PRE_POP_VOLS[@]}" for DIR in "${PRE_POPULATED_VOLUMES[@]}"
do do
if [ -n "$(find "$BBS_ROOT/$DIR" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then if [ -n "$(find "$BBS_ROOT_DIR/$DIR" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then
cp -rp $BBS_STG_P/$DIR/* $BBS_ROOT/$DIR/ cp -rp $BBS_STAGING_PATH/$DIR/* $BBS_ROOT_DIR/$DIR/
else else
printf "WARN: skipped $BBS_ROOT/$DIR: Volume not empty or not a new setup; Files required to run ENiGMA 1/2 may be missing.\n Possible bad state\n" printf "WARN: skipped $BBS_ROOT_DIR/$DIR: Volume not empty or not a new setup; Files required to run ENiGMA 1/2 may be missing.\n Possible bad state\n"
printf "INFO: You have mounted folders with existing data - but no existing config json.\n\nPossible solutions:\n1. Make sure all volumes are set correctly specifically config volume... \n2. Check your configuration name if non-default\n\n\n" printf "INFO: You have mounted folders with existing data - but no existing config json.\n\nPossible solutions:\n1. Make sure all volumes are set correctly specifically config volume... \n2. Check your configuration name if non-default\n\n\n"
fi fi
done done
./oputil.js config new ./oputil.js config new
fi fi
if [[ ! -f $BBS_ROOT/config/$CONFIG_NAME ]]; then # Make sure once more, otherwise pm2-runtime will loop if missing the config if [[ ! -f $BBS_ROOT_DIR/config/$CONFIG_NAME ]]; then # Make sure once more, otherwise pm2-runtime will loop if missing the config
printf "ERROR: Missing configuration - ENiGMA 1/2 will not work. please run config\n" printf "ERROR: Missing configuration - ENiGMA 1/2 will not work. please run config\n"
exit 1 exit 1