From 0555786435bc68786f6112fd4807797c7f6af85e Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Tue, 24 Oct 2023 07:41:17 +0200 Subject: [PATCH] fix bash logic --- ccp/modules/adt2fhir-rest-setup.sh | 18 ++++++++++-------- ccp/modules/nngm-setup.sh | 10 ++++------ ccp/vars | 1 - 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ccp/modules/adt2fhir-rest-setup.sh b/ccp/modules/adt2fhir-rest-setup.sh index 5003bd3..707d9c5 100644 --- a/ccp/modules/adt2fhir-rest-setup.sh +++ b/ccp/modules/adt2fhir-rest-setup.sh @@ -1,11 +1,13 @@ #!/bin/bash -if [ -n "$ENABLE_ADT2FHIR_REST" ]; then - log INFO "ADT2FHIR-REST setup detected -- will start adt2fhir-rest API." - if [ ! -n "$IDMANAGER_LOCAL_PATIENTLIST_APIKEY" ]; then - log ERROR "Missing ID-Management Module! Fix this by setting up ID Management:" - exit 1; +function adt2fhirRestSetup() { + if [ -n "$ENABLE_ADT2FHIR_REST" ]; then + log INFO "ADT2FHIR-REST setup detected -- will start adt2fhir-rest API." + if [ ! -n "$IDMANAGER_LOCAL_PATIENTLIST_APIKEY" ]; then + log ERROR "Missing ID-Management Module! Fix this by setting up ID Management:" + exit 1; + fi + OVERRIDE+=" -f ./$PROJECT/modules/adt2fhir-rest-compose.yml" + LOCAL_SALT="$(echo \"local-random-salt\" | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)" fi - OVERRIDE+=" -f ./$PROJECT/modules/adt2fhir-rest-compose.yml" - LOCAL_SALT="$(echo \"local-random-salt\" | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)" -fi +} diff --git a/ccp/modules/nngm-setup.sh b/ccp/modules/nngm-setup.sh index 3a0432f..56be949 100644 --- a/ccp/modules/nngm-setup.sh +++ b/ccp/modules/nngm-setup.sh @@ -1,8 +1,6 @@ #!/bin/bash -function nngmSetup() { - if [ -n "$NNGM_CTS_APIKEY" ]; then - log INFO "nNGM setup detected -- will start nNGM Connector." - OVERRIDE+=" -f ./$PROJECT/modules/nngm-compose.yml" - fi -} +if [ -n "$NNGM_CTS_APIKEY" ]; then + log INFO "nNGM setup detected -- will start nNGM Connector." + OVERRIDE+=" -f ./$PROJECT/modules/nngm-compose.yml" +fi diff --git a/ccp/vars b/ccp/vars index 9a0dbeb..7cfb7db 100644 --- a/ccp/vars +++ b/ccp/vars @@ -16,6 +16,5 @@ do done idManagementSetup -nngmSetup mtbaSetup adt2fhirRestSetup \ No newline at end of file