From 5fa65141eb30a30f68bdc96ffbeb593feb5a37bd Mon Sep 17 00:00:00 2001 From: Mykola Malkov Date: Mon, 24 Sep 2018 18:27:26 +0300 Subject: [PATCH] TT#37257 Overwrite config_deploy.inc with new values Change-Id: I0bb5793f20a961301e4157f9403b370d89cd0d4f (cherry picked from commit 953bed60c1c7729b2e0db8503cddf1bf4297318f) --- templates/scripts/includes/deployment.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index c15f401..34863b1 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -1503,10 +1503,11 @@ EOF } gen_installer_config () { - mkdir -p "${TARGET}/etc/ngcp-installer/" - - if "$CARRIER_EDITION" ; then - cat > ${TARGET}/etc/ngcp-installer/config_deploy.inc << EOF + local conf_file + conf_file="${TARGET}/etc/ngcp-installer/config_deploy.inc" + truncate -s 0 "${conf_file}" + if "${CARRIER_EDITION}" ; then + cat >> "${conf_file}" << EOF CROLE="${CROLE}" FILL_APPROX_CACHE="${FILL_APPROX_CACHE}" VLAN_BOOT_INT="${VLAN_BOOT_INT}" @@ -1518,9 +1519,8 @@ VLAN_HA_INT="${VLAN_HA_INT}" VLAN_RTP_EXT="${VLAN_RTP_EXT}" EOF fi - - if "$PRO_EDITION" ; then - cat >> ${TARGET}/etc/ngcp-installer/config_deploy.inc << EOF + if "${PRO_EDITION}" ; then + cat >> "${conf_file}" << EOF HNAME="${ROLE}" IP1="${IP1}" IP2="${IP2}" @@ -1542,7 +1542,7 @@ MANAGEMENT_IP="${MANAGEMENT_IP}" EOF fi - cat >> ${TARGET}/etc/ngcp-installer/config_deploy.inc << EOF + cat >> "${conf_file}" << EOF FORCE=yes ADJUST_FOR_LOW_PERFORMANCE="${ADJUST_FOR_LOW_PERFORMANCE}" ENABLE_VM_SERVICES="${ENABLE_VM_SERVICES}"