Merge #14 Better detection of OS

This commit is contained in:
Branislav Náter 2021-12-07 11:13:58 +00:00
commit d0885adef7

View file

@ -33,22 +33,23 @@ PACKAGES="${PACKAGES:-httpd}"
REQUIRES="${REQUIRES:-curl}"
rlJournalStart
rlPhaseStartSetup "Setup #1"
rlPhaseStartSetup "Setup Full-Release"
rlRun "rlImport httpd/http" 0 "Import httpd library"
rlAssertRpm --all
CONF="${httpCONFDIR}/conf/httpd.conf"
rlRun "rlFileBackup $CONF"
VERSION=`rpm -q --qf '%{VERSION}' $httpHTTPD`
RELEASE=`rpm -q --qf '%{RELEASE}' $httpHTTPD`
rlIsFedora && OS="Fedora"
rlIsCentOS && OS="CentOS"
rlIsRHEL && OS="Red Hat Enterprise Linux"
rlRun "rlFileBackup $CONF"
OS=$(source /etc/os-release; echo ${NAME})
rlIsRHEL 7 && OS="Red Hat Enterprise Linux"
# Full-Release not present in Fedora
if ! rlIsFedora; then
grep ServerTokens $CONF || rlRun "echo 'ServerTokens Full-Release' >> $CONF"
else
rlRun "sed -i 's/^ServerTokens.*/ServerTokens Full-Release/' $CONF"
fi
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "httpStart" 0 "Start httpd"