From f7501760c0e50b94d23a54df177e4e41b14c4c31 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 16 Sep 2016 10:17:06 +0200 Subject: [PATCH] MT#22675 decrypt: ignore shared storage on CE systems Change-Id: Ia90d022eabc518e60643019fadc84e8570fba5b3 --- scripts/decrypt | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/scripts/decrypt b/scripts/decrypt index cc169107..11f93bdd 100755 --- a/scripts/decrypt +++ b/scripts/decrypt @@ -57,6 +57,29 @@ log_debug() { } # }}} +setup_shared_config() { + if ! [ -d /mnt/glusterfs/mgmt-share ] ; then + log_warn "Looks like glusterfs is not running, can not install it automatically. + +Please execute the following command on one node +as soon as glusterfs share is mounted again: + + git clone --bare /etc/ngcp-config /mnt/glusterfs/ngcpcfg-share + /usr/share/ngcp-ngcpcfg/helper/restore-permissions /mnt/glusterfs/ngcpcfg-share + +" + return 0 + fi + + if [ -d /mnt/glusterfs/ngcpcfg-share ] ; then + log_info "Shared storage exists already, ignoring request to (re)install it." + else + log_info "Copying git repository to shared storage." + git clone --bare /etc/ngcp-config /mnt/glusterfs/ngcpcfg-share | sed "s/^/$timestamp_replacementchars/" + /usr/share/ngcp-ngcpcfg/helper/restore-permissions /mnt/glusterfs/ngcpcfg-share + fi +} + # main script if ! type -p gpg &>/dev/null ; then log_error "gpg binary not found, exiting." @@ -83,25 +106,11 @@ else fi fi -if ! [ -d /mnt/glusterfs/mgmt-share ] ; then - log_warn "Looks like glusterfs is not running, can not install it automatically. - -Please execute the following command on one node -as soon as glusterfs share is mounted again: - - git clone --bare /etc/ngcp-config /mnt/glusterfs/ngcpcfg-share - /usr/share/ngcp-ngcpcfg/helper/restore-permissions /mnt/glusterfs/ngcpcfg-share - - -" +# only for PRO/CARRIER +if [ -r /usr/share/ngcp-ngcpcfg/functions/ha_features ] ; then + setup_shared_config else - if [ -d /mnt/glusterfs/ngcpcfg-share ] ; then - log_info "Shared storage exists already, ignoring request to (re)install it." - else - log_info "Copying git repository to shared storage." - git clone --bare /etc/ngcp-config /mnt/glusterfs/ngcpcfg-share | sed "s/^/$timestamp_replacementchars/" - /usr/share/ngcp-ngcpcfg/helper/restore-permissions /mnt/glusterfs/ngcpcfg-share - fi + log_info "Ignoring shared configuration (PRO/CARRIER only)." fi # don't leave the unencrypted archive behind