From 058110cc1a1d33d0b1b5847a0f6f4a4229d91ae2 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 21 Sep 2011 12:16:00 +0000 Subject: [PATCH] deployment: do not create /etc/ngcp_ha_role + /etc/ngcp_ha_master if values are unset Otherwise we're creating broken systems which don't work as supposed. And while at it do not append variables to files but instead override any existing values, otherwise we might have broken config files. From: Michael Prokop --- deployment.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/deployment.sh b/deployment.sh index 7c504ee..cdb9c12 100755 --- a/deployment.sh +++ b/deployment.sh @@ -734,8 +734,19 @@ ff02::2 ip6-allrouters EOF if "$PRO_EDITION" ; then - echo $CROLE >> $TARGET/etc/ngcp_ha_role - echo $CMASTER >> $TARGET/etc/ngcp_ha_master + if [ -n "$CROLE" ] ; then + echo "Writing $CROLE to /etc/ngcp_ha_role" + echo $CROLE > $TARGET/etc/ngcp_ha_role + else + echo "No role definition set, not creating /etc/ngcp_ha_role" + fi + + if [ -n "$CMASTER" ] ; then + echo "Writing $CMASTER to /etc/ngcp_ha_master" + echo $CMASTER > $TARGET/etc/ngcp_ha_master + else + echo "No mgmgt master set, not creating /etc/ngcp_ha_master" + fi fi if "$PRO_EDITION" && [[ $(imvirt) != "Physical" ]] ; then