Commit dd3af4a7 authored by Luca Cinquini's avatar Luca Cinquini
Browse files

Re-creating archives after changing the ESGF password.

parent 30d7a364
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@
# the new password is obtained from the env variable ESGF_PASSWORD
# some password changes are executed directly inside each container

readonly BASE_DIR_PATH="$(pwd)"
SCRIPT_PARENT_DIR_PATH="$(dirname $0)"; cd "${SCRIPT_PARENT_DIR_PATH}"
readonly SCRIPT_PARENT_DIR_PATH="$(pwd)" ; cd "${BASE_DIR_PATH}"

if [ "${ESGF_PASSWORD}" = "" ] || [ "${ESGF_CONFIG}" = "" ];
then
   echo "All env variables: ESGF_PASSWORD, ESGF_CONFIG must be set  "
@@ -20,6 +24,10 @@ docker stop postgres
echo ${ESGF_PASSWORD} > ${ESGF_CONFIG}/esg/config/.esg_pg_pass
echo ${ESGF_PASSWORD} > ${ESGF_CONFIG}/esg/config/.esgf_pass
#sed -i.back 's/db.password=.*/db.password='"${ESGF_PASSWORD}"'/g' ${ESGF_CONFIG}/esg/config/esgf.properties
# must re-create the archive files containing the ESGF password
echo "Creating archives"
$SCRIPT_PARENT_DIR_PATH/manage_archives.sh


# change password to access the postgres databases in CoG settings file
# from within the running cog container