Suporte para Ubuntu 24.04

This commit is contained in:
Christian Tosta
2025-07-07 20:58:16 -03:00
parent 17fbb3bc90
commit 37a8a05951

View File

@@ -3,7 +3,7 @@
set -euo pipefail
self=$(basename ${0})
self=${self/.*bash}
version=2506.3
version=2507.1
# == Funções Gerais ============================================================================== #
@@ -21,7 +21,6 @@ function self.check_essential {
openssh-server:sshd \
sudo:sudo \
unzip:unzip \
tzdata:tzconfig \
"
local _not_found=
@@ -42,7 +41,7 @@ function self.check_essential {
read -p \
$"Aperte ENTER para instalar os pacotes agora [CTRL+C para cancelar]: "
apt-get update
apt-get install -yq ${_pkgs}
apt-get install -yq ${_pkgs} tzdata
fi
}
self.check_essential
@@ -254,7 +253,7 @@ function system.install_postgres {
local _pg_version=${1:-17}
local _citus_version=${2}
local POSTRES_PACKAGES="
local POSTGRES_PACKAGES="
libjemalloc2 \
postgresql-${_pg_version} \
"
@@ -276,7 +275,7 @@ function system.install_postgres {
${ui}.color none
local _pg_shared_preload=
if [[ ! -z "${_citus_version}" ]]; then
if [[ ! -z "${_citus_version:-}" ]]; then
${ui}.status info $"Habilitando repositório: PostgreSQL-Citus ..."
if [[ ! -f "/etc/apt/sources.list.d/citusdata_community.list" ]]; then
${ui}.color gold
@@ -290,15 +289,17 @@ function system.install_postgres {
${ui}.status tab "The repository is set up! You can now install packages."
${ui}.color none
fi
POSTRES_PACKAGES+=" postgresql-${_pg_version}-citus-${_citus_version/*-}"
POSTGRES_PACKAGES+=" postgresql-${_pg_version}-citus-${_citus_version/*-}"
_pg_shared_preload+="citus"
fi
system.install_pkgs ${POSTRES_PACKAGES}
system.install_pkgs ${POSTGRES_PACKAGES}
pg_conftool ${_pg_version} main set listen_addresses '*'
pg_conftool ${_pg_version} main set log_timezone 'America/Sao_Paulo'
if [[ ! -z "${_pg_shared_preload}" ]]; then
pg_conftool ${_pg_version} main set shared_preload_libraries ${_pg_shared_preload}
fi
local _pg_hba_file="/etc/postgresql/${_pg_version}/main/pg_hba.conf"
sudo cat <<-EOF | sed 's/^\s*\(.*\)/\1/g' > ${_pg_hba_file}
@@ -858,8 +859,14 @@ system.setlocale
system.check_net
system.setup_ntp
install_citus=0
${ui}.title $"Instalando e configurando serviços"
system.install_postgres 17 citus-13.0
if [[ ${install_citus} -eq 1 ]]; then
system.install_postgres 17 citus-13.0
else
system.install_postgres 17
fi
system.install_pyenv /usr/local/share/pyenv 2.7.18
${ui}.title $"Configurando contas de usuários"