Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / sdnc / components / sdnc-prom / resources / bin / ensureSdncActive.sh
index fb24653..d92a104 100755 (executable)
@@ -1,5 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 
+{{/*
 # Copyright © 2018 Amdocs
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+*/}}
 
 debugLog(){
-  if [ "$enableDebugLogging" == true ]; then
+  if [ "$enableDebugLogging" = true ]; then
      if [ $# -eq 0 ]; then
        echo "" >> $LOGFILE
      else
@@ -31,8 +33,8 @@ failover(){
     debugLog "Currently running sdnc and dns failover"
     return
   fi
-  trap "rm -f ${lockFile}" INT TERM RETURN
-  echo $BASHPID > ${lockFile}
+  trap "rm -f ${lockFile}" INT TERM EXIT
+  echo $$ > ${lockFile}
 
   # perform takeover
   debugLog "Started executing sdnc.failover for $SITE_NAME"