Update tools.func
This commit is contained in:
parent
807edc2845
commit
882562d9e0
@ -187,21 +187,16 @@ function setup_postgresql() {
|
|||||||
|
|
||||||
echo "deb https://apt.postgresql.org/pub/repos/apt ${DISTRO}-pgdg main" \
|
echo "deb https://apt.postgresql.org/pub/repos/apt ${DISTRO}-pgdg main" \
|
||||||
>/etc/apt/sources.list.d/pgdg.list
|
>/etc/apt/sources.list.d/pgdg.list
|
||||||
$STD msg_ok "Repository added"
|
|
||||||
|
|
||||||
$STD apt-get update
|
$STD apt-get update
|
||||||
|
$STD msg_ok "Repository added"
|
||||||
|
|
||||||
msg_info "Setup PostgreSQL $PG_VERSION"
|
msg_info "Setup PostgreSQL $PG_VERSION"
|
||||||
$STD apt-get install -y "postgresql-${PG_VERSION}" "postgresql-client-${PG_VERSION}"
|
$STD apt-get install -y "postgresql-${PG_VERSION}" "postgresql-client-${PG_VERSION}"
|
||||||
msg_ok "Setup PostgreSQL $PG_VERSION"
|
|
||||||
|
|
||||||
if [[ -n "$CURRENT_PG_VERSION" ]]; then
|
if [[ -n "$CURRENT_PG_VERSION" ]]; then
|
||||||
$STD apt-get purge -y "postgresql-${CURRENT_PG_VERSION}" "postgresql-client-${CURRENT_PG_VERSION}" || true
|
$STD apt-get purge -y "postgresql-${CURRENT_PG_VERSION}" "postgresql-client-${CURRENT_PG_VERSION}" || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$STD msg_info "Starting PostgreSQL $PG_VERSION"
|
|
||||||
systemctl enable -q --now postgresql
|
systemctl enable -q --now postgresql
|
||||||
$STD msg_ok "PostgreSQL $PG_VERSION started"
|
|
||||||
|
|
||||||
if [[ -n "$CURRENT_PG_VERSION" ]]; then
|
if [[ -n "$CURRENT_PG_VERSION" ]]; then
|
||||||
$STD msg_info "Restoring dumped data"
|
$STD msg_info "Restoring dumped data"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user