Update postgres.sh
This commit is contained in:
parent
ce625ee7b8
commit
0174f16520
|
|
@ -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;";
|
||||
|
|
|
|||
Loading…
Reference in New Issue