Big Refactor

This commit is contained in:
John
2025-04-27 12:34:26 +12:00
parent d5c7dc7de6
commit 8614d29b06
20 changed files with 64 additions and 101 deletions

View File

@ -14,41 +14,6 @@ die() {
exit 1
}
# Load environment variables from .env file
# Usage: load_env [path_to_env_file]
# If no path is provided, looks for .env in the same directory as the script
load_env() {
local script_dir="$(dirname "${BASH_SOURCE[0]}")"
local env_file
# first load basic.env for the template defaults
if [ -f "$script_dir/_basic.env" ]; then
set -a
source "$script_dir/_basic.env"
set +a
else
echo "Warning: _basic.env file not found at $script_dir/_basic.env. Broken template?"
return 1
fi
# now load the server specific env file
if [ -z "$1" ]; then
echo "Usage: $0 [path_to_env_file]"
return 1
fi
env_file="$1/service.env"
if [ ! -f "$env_file" ]; then
echo "Warning: service.env file not found at $1"
return 1
fi
set -a
source "$env_file"
set +a
}
grey_start() {
echo -e -n "\033[90m"
}