From f67a298c2776c75a189847efc04389ee209f59d3 Mon Sep 17 00:00:00 2001 From: Tommy Miland Date: Wed, 2 Oct 2024 16:17:08 +0200 Subject: [PATCH] Add folder check for /etc/postgresql - Added folder check for /etc/postgresql --- invidious_update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invidious_update.sh b/invidious_update.sh index 0350908..9ac8e60 100755 --- a/invidious_update.sh +++ b/invidious_update.sh @@ -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" @@ -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" @@ -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"