Update alpine-postgresql-install.sh

This commit is contained in:
CanbiZ 2025-04-08 16:11:01 +02:00
parent 90f59e9014
commit 96b2170e94

View File

@ -14,26 +14,23 @@ network_check
update_os update_os
msg_info "Installing PostgreSQL" msg_info "Installing PostgreSQL"
$STD apk add --no-cache postgresql16 postgresql16-contrib postgresql16-openrc $STD apk add --no-cache postgresql16 postgresql16-contrib postgresql16-openrc sudo
msg_ok "Installed PostgreSQL" msg_ok "Installed PostgreSQL"
msg_info "Enabling PostgreSQL Service" msg_info "Enabling PostgreSQL Service"
rc-update add postgresql default $STD rc-update add postgresql default
msg_ok "Enabled PostgreSQL Service" msg_ok "Enabled PostgreSQL Service"
msg_info "Starting PostgreSQL" msg_info "Starting PostgreSQL"
rc-service postgresql start $STD rc-service postgresql start
msg_ok "Started PostgreSQL" msg_ok "Started PostgreSQL"
msg_info "Configuring PostgreSQL for External Access" msg_info "Configuring PostgreSQL for External Access"
conf_file="/etc/postgresql16/postgresql.conf" conf_file="/etc/postgresql16/postgresql.conf"
hba_file="/etc/postgresql16/pg_hba.conf" hba_file="/etc/postgresql16/pg_hba.conf"
sed -i 's/^#listen_addresses =.*/listen_addresses = '\''*'\''/' "$conf_file" sed -i 's/^#listen_addresses =.*/listen_addresses = '\''*'\''/' "$conf_file"
sed -i '/^host\s\+all\s\+all\s\+127.0.0.1\/32\s\+md5/ s/.*/host all all 0.0.0.0\/0 md5/' "$hba_file" sed -i '/^host\s\+all\s\+all\s\+127.0.0.1\/32\s\+md5/ s/.*/host all all 0.0.0.0\/0 md5/' "$hba_file"
$STD rc-service postgresql restart
rc-service postgresql restart
msg_ok "Configured and Restarted PostgreSQL" msg_ok "Configured and Restarted PostgreSQL"
read -r -p "Would you like to install Adminer with lighttpd? <y/N>: " prompt read -r -p "Would you like to install Adminer with lighttpd? <y/N>: " prompt