[COMMON] Fix 'trap RETURN' and $BASHPID bashisms
[oom.git] / kubernetes / sdnc / components / sdnc-prom / resources / bin / ensureSdncActive.sh
index feb6662..d92a104 100755 (executable)
@@ -1,6 +1,6 @@
-#!/bin/bash
-{{/*
+#!/bin/sh
 
+{{/*
 # Copyright © 2018 Amdocs
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,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"