Blame SOURCES/bz1751949-2-SAPInstance-improve-profile-detection.patch

c98ed0
From 8eda4725a946ca669df035ed0ffdf053a65e1258 Mon Sep 17 00:00:00 2001
c98ed0
From: Fabian Herschel <fabian.herschel@suse.com>
c98ed0
Date: Thu, 2 Aug 2018 15:36:31 +0200
c98ed0
Subject: [PATCH] SAPInstance: Improved SAP instance profile detection
c98ed0
c98ed0
---
c98ed0
 heartbeat/SAPInstance | 6 +++++-
c98ed0
 1 file changed, 5 insertions(+), 1 deletion(-)
c98ed0
c98ed0
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
c98ed0
index 174ea36ef..eb058cccf 100755
c98ed0
--- a/heartbeat/SAPInstance
c98ed0
+++ b/heartbeat/SAPInstance
c98ed0
@@ -371,7 +371,11 @@ sapinstance_init() {
c98ed0
 
c98ed0
   if [ -z "$currentSTART_PROFILE" ]
c98ed0
   then
c98ed0
-    SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
c98ed0
+    if [ ! -r "$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}" -a -r "$DIR_PROFILE/${SID}_${InstanceName}_${SAPVIRHOST}" ]; then
c98ed0
+      SAPSTARTPROFILE="$DIR_PROFILE/${SID}_${InstanceName}_${SAPVIRHOST}"
c98ed0
+    else
c98ed0
+      SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
c98ed0
+    fi
c98ed0
   else
c98ed0
     SAPSTARTPROFILE="$currentSTART_PROFILE"
c98ed0
   fi