Skip to content

Commit

Permalink
Add folder check for /etc/postgresql
Browse files Browse the repository at this point in the history
- Added folder check for /etc/postgresql
  • Loading branch information
tmiland committed Oct 2, 2024
1 parent 222835e commit f67a298
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions invidious_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ if [[ $DISTRO_GROUP == "Debian" ]]; then
# System cmd
SYSTEM_CMD="systemctl"
# Postgresql config folder
pgsql_config_folder=$(find "/etc/postgresql/" -maxdepth 1 -type d -name "*" | sort -V | tail -1)
pgsql_config_folder=$(if [[ -d "/etc/postgresql/" ]]; then find "/etc/postgresql/" -maxdepth 1 -type d -name "*" | sort -V | tail -1; fi)
elif [[ $(lsb_release -si) == "CentOS" ]]; then
SUDO="sudo"
UPDATE="yum update -q"
Expand All @@ -258,7 +258,7 @@ elif [[ $(lsb_release -si) == "CentOS" ]]; then
# System cmd
SYSTEM_CMD="systemctl"
# Postgresql config folder
pgsql_config_folder=$(find "/etc/postgresql/" -maxdepth 1 -type d -name "*" | sort -V | tail -1)
pgsql_config_folder=$(if [[ -d "/etc/postgresql/" ]]; then find "/etc/postgresql/" -maxdepth 1 -type d -name "*" | sort -V | tail -1; fi)
elif [[ $(lsb_release -si) == "Fedora" ]]; then
SUDO="sudo"
UPDATE="dnf update -q"
Expand All @@ -281,7 +281,7 @@ elif [[ $(lsb_release -si) == "Fedora" ]]; then
# System cmd
SYSTEM_CMD="systemctl"
# Postgresql config folder
pgsql_config_folder=$(find "/etc/postgresql/" -maxdepth 1 -type d -name "*" | sort -V | tail -1)
pgsql_config_folder=$(if [[ -d "/etc/postgresql/" ]]; then find "/etc/postgresql/" -maxdepth 1 -type d -name "*" | sort -V | tail -1; fi)
elif [[ $DISTRO_GROUP == "Arch" ]]; then
SUDO="sudo"
UPDATE="pacman -Syu"
Expand Down

0 comments on commit f67a298

Please sign in to comment.