Article 56XVS [SOLVED] CentOS8 if condition being ignored

[SOLVED] CentOS8 if condition being ignored

by
witchkinkofangmar
from LinuxQuestions.org on (#56XVS)
Trying to differentiate between CentOS7 and CentOS8 and the CentOS8 condition is being skipped and I'm not sure why.

Code:release=$(cat /etc/redhat-release | awk '{print $1,$2}')
release8="cut -c22 /etc/redhat-release"

if [[ -d "$sepDir" ]]; then
echo "$(tput setaf 1)$(tput setab 7)Symantec Endpoint Protection is already installed.$(tput sgr 0)"
elif [[ ! -d "$sepDir" && $release == 'Red Hat' ]]; then
echo "$(tput setaf 1)$(tput setab 7)RHEL Install.$(tput sgr 0)"
sepInstallRHEL
elif [[ ! -d "$sepDir" && "$release8" == '8' ]]; then
echo "CentOS 8 install"
sepInstallCentOS8
elif [[ ! -d "$sepDir" && $release == 'CentOS Linux' || $release == 'CentOS release' ]]; then
echo "$(tput setaf 1)$(tput setab 7)CentOS Install.$(tput sgr 0)"
sepInstallCentOS
else
echo "An error has occurred. Please contact your Systems Administrator."
filatest?d=yIl2AUoC8zA latest?i=ZK4YgALElnM:C8_Cxyb-Ad0:F7zBnMy latest?i=ZK4YgALElnM:C8_Cxyb-Ad0:V_sGLiP latest?d=qj6IDK7rITs latest?i=ZK4YgALElnM:C8_Cxyb-Ad0:gIN9vFwZK4YgALElnM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments