From e9125098f8385ee5e23f2b85edc03457581acdb2 Mon Sep 17 00:00:00 2001 From: lelo Date: Fri, 18 Apr 2025 21:56:57 +0000 Subject: [PATCH] path to config file as argument --- mount_folder.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mount_folder.sh b/mount_folder.sh index 24512e2..396e0a7 100755 --- a/mount_folder.sh +++ b/mount_folder.sh @@ -4,7 +4,19 @@ # Load Configuration from json ############################################################################### -CONFIG_FILE="folder_mount_config.json" +# Require the config‑file 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. if ! command -v jq >/dev/null 2>&1; then