Update postgresql.sh

This commit is contained in:
FusionPBX 2018-05-16 12:31:57 -06:00 committed by GitHub
parent b8064c7cb0
commit d55ab39c94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

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" echo "Install PostgreSQL and create the database and users\n"
#postgres install #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 if [ ."$database_version" = ."9.6" ]; then
pkg install --yes postgresql96-server pkg install --yes postgresql96-server
#cd /usr/ports/databases/postgresql96-server/ && make install clean BATCH=yes #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 /usr/local/etc/rc.d/postgresql initdb
#start postgresql #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 if [ ."$database_version" = ."9.6" ]; then
sudo -u postgres /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 fi