From f597ae09aaa865f7372b25b03dd780ed429f8076 Mon Sep 17 00:00:00 2001 From: Tomi Eckert Date: Mon, 6 Oct 2025 10:55:10 +0200 Subject: [PATCH] feat(monitor): Implement conditional configuration in monitor.hook.sh --- monitor/monitor.hook.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/monitor/monitor.hook.sh b/monitor/monitor.hook.sh index 4cf946f..1c34779 100644 --- a/monitor/monitor.hook.sh +++ b/monitor/monitor.hook.sh @@ -2,13 +2,24 @@ # This script helps to configure monitor.conf +# Source the monitor.conf to get current values +source monitor/monitor.conf + +# Check if COMPANY_NAME or NTFY_TOKEN are still default +if [ "$COMPANY_NAME" = "Company" ] || [ "$NTFY_TOKEN" = "tk_xxxxx" ]; then + echo "Default COMPANY_NAME or NTFY_TOKEN detected. Running configuration..." +else + echo "COMPANY_NAME and NTFY_TOKEN are already configured. Exiting." + exit 0 +fi + # Prompt for COMPANY_NAME read -p "Enter Company Name (e.g., MyCompany): " COMPANY_NAME_INPUT -COMPANY_NAME_INPUT=${COMPANY_NAME_INPUT:-"Company"} # Default value +COMPANY_NAME_INPUT=${COMPANY_NAME_INPUT:-"$COMPANY_NAME"} # Default to current value if not provided # Prompt for NTFY_TOKEN read -p "Enter ntfy.sh token (e.g., tk_xxxxx): " NTFY_TOKEN_INPUT -NTFY_TOKEN_INPUT=${NTFY_TOKEN_INPUT:-"tk_xxxxx"} # Default value +NTFY_TOKEN_INPUT=${NTFY_TOKEN_INPUT:-"$NTFY_TOKEN"} # Default to current value if not provided # Define HANA client paths HDB_CLIENT_PATH="/usr/sap/hdbclient"