Initialize the database

Install on Debian 12 failed to initialize the database on its own so adding pg_createcluster to do this.
This commit is contained in:
FusionPBX 2023-09-21 15:43:43 -06:00 committed by GitHub
parent 49e2fb434d
commit c2bba26431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 9 deletions

View File

@ -58,15 +58,6 @@ if [ ."$database_repo" = ."2ndquadrant" ]; then
fi
fi
#systemd
if [ ."$database_host" = ."127.0.0.1" ] || [ ."$database_host" = ."::1" ] ; then
systemctl daemon-reload
systemctl restart postgresql
fi
#init.d
#/usr/sbin/service postgresql restart
#install the database backup
#cp backup/fusionpbx-backup /etc/cron.daily
#cp backup/fusionpbx-maintenance /etc/cron.daily
@ -75,9 +66,21 @@ fi
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-maintenance
#initialize the database
pg_createcluster $database_version main
#replace scram-sha-256 with md5
sed -i /etc/postgresql/$database_version/main/pg_hba.conf -e '/^#/!s/scram-sha-256/md5/g'
#systemd
if [ ."$database_host" = ."127.0.0.1" ] || [ ."$database_host" = ."::1" ] ; then
systemctl daemon-reload
systemctl restart postgresql
fi
#init.d
#/usr/sbin/service postgresql restart
#move to /tmp to prevent a red herring error when running sudo with psql
cwd=$(pwd)
cd /tmp