This commit is contained in:
Your Name
2025-04-25 12:53:03 +12:00
parent 7e499195e5
commit 2f3135053f
16 changed files with 162 additions and 119 deletions

View File

@ -1,5 +1,12 @@
#!/bin/bash
# COMMON FUNCTIONS
# JDE
# 2025-04-25
# This file is not required if you write your own template.
# Print error message and exit with code 1
# Usage: die "error message"
die() {
@ -13,7 +20,18 @@ die() {
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