pg_isready can use SSL

This commit is contained in:
Grant Limberg 2022-06-21 14:36:40 -07:00
parent 26d1cf9186
commit f44b122262
No known key found for this signature in database
GPG Key ID: 8F2F97D3BE8D7735

View File

@ -79,10 +79,17 @@ echo "{
}
" > /var/lib/zerotier-one/local.conf
until /usr/pgsql-10/bin/pg_isready -h ${ZT_DB_HOST} -p ${ZT_DB_PORT}; do
echo "Waiting for PostgreSQL...";
sleep 2;
done
if [ -n "$DB_SERVER_CA" ]; then
until /usr/pgsql-10/bin/pg_isready -h ${ZT_DB_HOST} -p ${ZT_DB_PORT} -d "sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}"; do
echo "Waiting for PostgreSQL...";
sleep 2;
done
else
until /usr/pgsql-10/bin/pg_isready -h ${ZT_DB_HOST} -p ${ZT_DB_PORT}; do
echo "Waiting for PostgreSQL...";
sleep 2;
done
fi
export GLIBCXX_FORCE_NEW=1
export GLIBCPP_FORCE_NEW=1