feat(monitor): Implement conditional configuration in monitor.hook.sh
This commit is contained in:
@@ -2,13 +2,24 @@
|
|||||||
|
|
||||||
# This script helps to configure monitor.conf
|
# 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
|
# Prompt for COMPANY_NAME
|
||||||
read -p "Enter Company Name (e.g., MyCompany): " COMPANY_NAME_INPUT
|
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
|
# Prompt for NTFY_TOKEN
|
||||||
read -p "Enter ntfy.sh token (e.g., tk_xxxxx): " NTFY_TOKEN_INPUT
|
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
|
# Define HANA client paths
|
||||||
HDB_CLIENT_PATH="/usr/sap/hdbclient"
|
HDB_CLIENT_PATH="/usr/sap/hdbclient"
|
||||||
|
|||||||
Reference in New Issue
Block a user