Update Ubuntu install PostgreSQL if the database_host is 127.0.0.1 or ::1

This commit is contained in:
FusionPBX 2021-06-07 19:00:20 -06:00 committed by GitHub
parent e81f22f4c7
commit 4ad6ce0b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 11 deletions

View File

@ -27,22 +27,30 @@ if [ ."$database_repo" = ."official" ]; then
echo "deb http://apt.postgresql.org/pub/repos/apt/ $os_codename-pgdg main" > /etc/apt/sources.list.d/postgresql.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update && apt-get upgrade -y
if [ ."$database_version" = ."latest" ]; then
apt-get install -y sudo postgresql
if [ ."$database_host" = ."127.0.0.1" ] || [ ."$database_host" = ."::1" ] ; then
if [ ."$database_version" = ."latest" ]; then
apt-get install -y sudo postgresql
fi
if [ ."$database_version" = ."9.6" ]; then
apt-get install -y sudo postgresql-$database_version
fi
if [ ."$database_version" = ."9.4" ]; then
apt-get install -y sudo postgresql-$database_version
fi
fi
if [ ."$database_version" = ."9.6" ]; then
apt-get install -y sudo postgresql-$database_version
fi
if [ ."$database_version" = ."9.4" ]; then
apt-get install -y sudo postgresql-$database_version
fi
fi
#add PostgreSQL and 2ndquadrant repos
if [ ."$database_repo" = ."2ndquadrant" ]; then
apt install -y curl
curl https://dl.2ndquadrant.com/default/release/get/deb | bash
apt-get install -y sudo postgresql-bdr-9.4 postgresql-bdr-9.4-bdr-plugin postgresql-bdr-contrib-9.4
if [ ."$database_host" = ."127.0.0.1" ] || [ ."$database_host" = ."::1" ] ; then
apt install -y curl
curl https://dl.2ndquadrant.com/default/release/get/deb | bash
if [ ."$os_codename" = ."focal" ]; then
sed -i /etc/apt/sources.list.d/2ndquadrant-dl-default-release.list -e 's#focal#bionic#g'
fi
apt update
apt-get install -y sudo postgresql-bdr-9.4 postgresql-bdr-9.4-bdr-plugin postgresql-bdr-contrib-9.4
fi
fi
#add additional dependencies