Update install.sh

This commit is contained in:
dinger1986
2023-12-03 20:18:55 +00:00
committed by GitHub
parent 068ec88f2d
commit 4d83ea1720

View File

@@ -170,7 +170,8 @@ echo "Installing Postgresql"
if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then
sudo apt-get install -y postgresql > null sudo apt-get install -y postgresql > null
elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] || [ "${UPSTREAM_ID}" = "suse" ]; then elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "${OS}" = "Almalinux" ] || [ "${UPSTREAM_ID}" = "Rocky*" ] || [ "${UPSTREAM_ID}" = "suse" ]; then
sudo yum install -y postgresql sudo yum install -y postgresql-server
/usr/bin/postgresql-setup --initdb
elif [ "${ID}" = "arch" ] || [ "${UPSTREAM_ID}" = "arch" ]; then elif [ "${ID}" = "arch" ] || [ "${UPSTREAM_ID}" = "arch" ]; then
sudo pacman -S postgresql sudo pacman -S postgresql
else else
@@ -181,7 +182,7 @@ sudo systemctl enable postgresql
sudo systemctl start postgresql sudo systemctl start postgresql
while ! [[ $CHECK_POSTGRES_SERVICE ]]; do while ! [[ $CHECK_POSTGRES_SERVICE ]]; do
CHECK_POSTGRES_SERVICE=$(sudo systemctl status postgresql.service | grep "Active: active (exited)") CHECK_POSTGRES_SERVICE=$(sudo systemctl status postgresql.service | grep -E "Active: active \(running\)|Active: active \(exited\)")
echo -ne "PostgreSQL is not ready yet...${NC}\n" echo -ne "PostgreSQL is not ready yet...${NC}\n"
sleep 3 sleep 3
done done