path to config file as argument
This commit is contained in:
parent
75262a1957
commit
e9125098f8
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user