Skip to content
Snippets Groups Projects
Commit 12b54b7a authored by Jakub Klinkovský's avatar Jakub Klinkovský Committed by Jelle van der Waa
Browse files

upgrade_pg.sh: fix check for existing SSL certs

Full file path is needed for the file existence check. The bug was
caused by commit 0d2e6e50
parent 3bb92c71
No related branches found
No related tags found
1 merge request!193roles/postgres: make the upgrade_pg.sh script more robust
......@@ -38,9 +38,12 @@ su - postgres -c 'chattr -f +C /var/lib/postgres/data' || :
su - postgres -c 'initdb --locale en_US.UTF-8 -E UTF8 -D /var/lib/postgres/data'
vimdiff /var/lib/postgres/{data,data-$FROM_VERSION}/pg_hba.conf
vimdiff /var/lib/postgres/{data,data-$FROM_VERSION}/postgresql.conf
# copy existing SSL certs from data-$FROM_VERSION to data
for f in {fullchain,chain,privkey}.pem; do
[[ -e $f ]] || continue
cp -avx /var/lib/postgres/data-$FROM_VERSION/$f /var/lib/postgres/data/$f
if [[ -e /var/lib/postgres/data-$FROM_VERSION/$f ]]; then
cp -avx /var/lib/postgres/{data-$FROM_VERSION,data}/$f
fi
done
systemctl stop postgresql.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment