diff --git a/keymanager.sh b/keymanager.sh index 00a74da..c1a4083 100644 --- a/keymanager.sh +++ b/keymanager.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Version: 1.2.2 +# Version: 1.2.3 # Author: Tomi Eckert # A script to interactively manage SAP HANA hdbuserstore keys, with testing. @@ -13,7 +13,20 @@ COLOR_NC='\033[0m' # No Color # --- Configuration --- # Adjust these paths if your HANA client is installed elsewhere. -HDB_CLIENT_PATH="/usr/sap/hdbclient" +# Define potential HDB client paths +HDB_CLIENT_PATH_1="/usr/sap/hdbclient" +HDB_CLIENT_PATH_2="/usr/sap/NDB/HDB00/exe" + +# Check which path exists and set HDB_CLIENT_PATH accordingly +if [ -d "$HDB_CLIENT_PATH_1" ]; then + HDB_CLIENT_PATH="$HDB_CLIENT_PATH_1" +elif [ -d "$HDB_CLIENT_PATH_2" ]; then + HDB_CLIENT_PATH="$HDB_CLIENT_PATH_2" +else + echo -e "${COLOR_RED}❌ Error: Neither '$HDB_CLIENT_PATH_1' nor '$HDB_CLIENT_PATH_2' found.${COLOR_NC}" + echo -e "${COLOR_RED}Please install the SAP HANA client or adjust the paths in the script.${COLOR_NC}" + exit 1 +fi HDB_USERSTORE_EXEC="${HDB_CLIENT_PATH}/hdbuserstore" HDB_SQL_EXEC="${HDB_CLIENT_PATH}/hdbsql" diff --git a/packages.conf b/packages.conf index 88902a6..67cea9a 100644 --- a/packages.conf +++ b/packages.conf @@ -13,6 +13,6 @@ declare -A SCRIPT_PACKAGES SCRIPT_PACKAGES["aurora"]="Aurora Suite|2.1.0|A collection of scripts for managing Aurora database instances.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/aurora/aurora.sh https://git.technopunk.space/tomi/Scripts/raw/branch/main/aurora/aurora.conf" SCRIPT_PACKAGES["backup"]="Backup Suite|1.0.8|A comprehensive script for backing up system files and databases.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/backup/backup.sh https://git.technopunk.space/tomi/Scripts/raw/branch/main/backup/backup.conf" SCRIPT_PACKAGES["monitor"]="Monitor Suite|1.3.1|Scripts for monitoring system health and performance metrics.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/monitor/monitor.sh https://git.technopunk.space/tomi/Scripts/raw/branch/main/monitor/monitor.conf|https://git.technopunk.space/tomi/Scripts/raw/branch/main/monitor/monitor.hook.sh" -SCRIPT_PACKAGES["keymanager"]="Key Manager|1.2.2|A utility for managing HDB user keys for SAP HANA.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/keymanager.sh" +SCRIPT_PACKAGES["keymanager"]="Key Manager|1.2.3|A utility for managing HDB user keys for SAP HANA.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/keymanager.sh" SCRIPT_PACKAGES["cleaner"]="File Cleaner|1.1.0|A simple script to clean up temporary files and logs.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/cleaner.sh" SCRIPT_PACKAGES["hanatool"]="HANA Tool|1.5.5|A command-line tool for various SAP HANA administration tasks.|https://git.technopunk.space/tomi/Scripts/raw/branch/main/hanatool.sh"