Skip to content

Commit f1ff45f

Browse files
authored
backup the original file just in case
Signed-off-by: Daniel Hansson <[email protected]>
1 parent 84ed27c commit f1ff45f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

nextcloud_update.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ then
910910
if ! sudo -u postgres psql -c "\q"
911911
then
912912
# If it fails, trust the 'postgres' user to be able to perform backup
913+
rsync -a /etc/postgresql/*/main/pg_hba.conf "$BACKUP"/pg_hba.conf_BACKUP
913914
sed -i "s|local all postgres .*|local all postgres trust|g" /etc/postgresql/*/main/pg_hba.conf
914915
systemctl restart postgresql.service
915916
if sudo -u postgres psql -c "SELECT 1 AS result FROM pg_database WHERE datname='$NCDB'" | grep "1 row" > /dev/null

0 commit comments

Comments
 (0)