Update postgresql.sh

This commit is contained in:
FusionPBX
2018-05-16 12:31:57 -06:00
committed by GitHub
parent b8064c7cb0
commit d55ab39c94

View File

@@ -24,6 +24,10 @@ password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 20)
echo "Install PostgreSQL and create the database and users\n"
#postgres install
if [ ."$database_version" = ."10" ]; then
pkg install --yes postgresql10-server
#cd /usr/ports/databases/postgresql10-server/ && make install clean BATCH=yes
fi
if [ ."$database_version" = ."9.6" ]; then
pkg install --yes postgresql96-server
#cd /usr/ports/databases/postgresql96-server/ && make install clean BATCH=yes
@@ -48,6 +52,9 @@ echo 'postgresql_enable=true' >> /etc/rc.conf
/usr/local/etc/rc.d/postgresql initdb
#start postgresql
if [ ."$database_version" = ."10" ]; then
sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data10 -l logfile start
fi
if [ ."$database_version" = ."9.6" ]; then
sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data96 -l logfile start
fi