From 6eff84ff5df72d35a457e1e26df602dd1680861e Mon Sep 17 00:00:00 2001 From: ronivay Date: Mon, 3 May 2021 17:38:14 +0300 Subject: [PATCH] move osname/osversion checks to beginning of checkos function --- xo-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xo-install.sh b/xo-install.sh index b714cd6..f70f14e 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -869,6 +869,9 @@ function RollBackInstallation { function CheckOS { + OSVERSION=$(grep ^VERSION_ID /etc/os-release | cut -d'=' -f2 | grep -Eo "[0-9]{1,2}" | head -1) + OSNAME=$(grep ^NAME /etc/os-release | cut -d'=' -f2 | sed 's/"//g' | awk '{print $1}') + cmdlog "which yum" if [[ "$(which yum 2>>$LOGFILE)" ]]; then PKG_FORMAT="rpm" @@ -888,9 +891,6 @@ function CheckOS { return 0 fi - OSVERSION=$(grep ^VERSION_ID /etc/os-release | cut -d'=' -f2 | grep -Eo "[0-9]{1,2}" | head -1) - OSNAME=$(grep ^NAME /etc/os-release | cut -d'=' -f2 | sed 's/"//g' | awk '{print $1}') - if [[ ! $OSNAME =~ ^(Debian|Ubuntu|CentOS|AlmaLinux)$ ]]; then printfail "Only Ubuntu/Debian/CentOS/AlmaLinux supported" exit 1