Update postgres.sh

This commit is contained in:
FusionPBX 2017-04-01 03:18:25 -06:00 committed by GitHub
parent ce625ee7b8
commit 0174f16520
1 changed files with 5 additions and 5 deletions

View File

@ -36,12 +36,16 @@ rehash
#enable postgres
echo 'postgresql_enable=true' >> /etc/rc.conf
#move to /tmp to prevent an error when running sudo with psql
cwd=$(pwd)
cd /tmp
#initialize the database
/usr/local/etc/rc.d/postgresql initdb
#start postgresql
if [ ."$database_version" = ."9.6" ]; then
/usr/local/bin/pg_ctl -D /var/db/postgres/data96 -l logfile start
sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data96 -l logfile start
fi
#restart the service
@ -52,10 +56,6 @@ service postgresql restart
#chmod 755 /etc/cron.daily/fusionpbx-backup.sh
#sed -i' ' -e "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup.sh
#move to /tmp to prevent an error when running sudo with psql
cwd=$(pwd)
cd /tmp
#add the databases, users and grant permissions to them
#sudo -u postgres psql -d fusionpbx -c "DROP SCHEMA public cascade;";
#sudo -u postgres psql -d fusionpbx -c "CREATE SCHEMA public;";