fix source command
This commit is contained in:
@@ -4,14 +4,23 @@ set -euo pipefail
|
||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Load config
|
||||
# Load config (safe parser — only loads KEY=VALUE lines)
|
||||
# ------------------------------------------------------------------
|
||||
if [ ! -f "$REPO_ROOT/.env" ]; then
|
||||
echo "ERROR: $REPO_ROOT/.env not found. Copy .env.example and fill in values."
|
||||
exit 1
|
||||
fi
|
||||
source "$REPO_ROOT/.env"
|
||||
DATA_ROOT="${DATA_ROOT:-/opt/docker-data}"
|
||||
set -a
|
||||
eval "$(grep -v '^#' "$REPO_ROOT/.env" | grep -v '^$' | grep '^[A-Za-z_][A-Za-z_0-9]*=' )"
|
||||
set +a
|
||||
|
||||
# Validate required variables
|
||||
for var in DOMAIN DATA_ROOT; do
|
||||
if [ -z "${!var:-}" ]; then
|
||||
echo "ERROR: $var is not set in .env"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "==> VPS info:"
|
||||
cat /etc/os-release
|
||||
|
||||
Reference in New Issue
Block a user