path to config file as argument

This commit is contained in:
lelo 2025-04-18 21:56:57 +00:00
parent 75262a1957
commit e9125098f8

View File

@ -4,7 +4,19 @@
# Load Configuration from json # Load Configuration from json
############################################################################### ###############################################################################
CONFIG_FILE="folder_mount_config.json" # Require the configfile path as the first argument:
CONFIG_FILE="$1"
if [[ -z "$CONFIG_FILE" ]]; then
echo "[ERROR] No path to config file given"
exit 1
fi
# Ensure the file actually exists:
if [[ ! -f "$CONFIG_FILE" ]]; then
echo "[ERROR] Config file '$CONFIG_FILE' not found."
exit 1
fi
# Ensure jq is installed before proceeding. # Ensure jq is installed before proceeding.
if ! command -v jq >/dev/null 2>&1; then if ! command -v jq >/dev/null 2>&1; then