Fix to handle Fedora
This commit is contained in:
parent
85bff41042
commit
90001f001b
1 changed files with 17 additions and 7 deletions
24
install.sh
24
install.sh
|
|
@ -52,9 +52,14 @@ detect_os () {
|
|||
then
|
||||
distro="LEAP12"
|
||||
fi
|
||||
if [[ -f /etc/centos-release || -f /etc/redhat-release ]]
|
||||
if [[ -f /etc/centos-release || -f /etc/redhat-release || -f /etc/fedora-release ]]
|
||||
then
|
||||
distro="RedHat"
|
||||
if [[ -f /etc/fedora-release ]]
|
||||
then
|
||||
distro="Fedora"
|
||||
else
|
||||
distro="RedHat"
|
||||
fi
|
||||
fi
|
||||
if [[ $(cat /etc/os-release | grep -e "^CPE_NAME\=*" | cut -f 2 -d '=') =~ cpe:/o:suse:sles:12 ]]
|
||||
then
|
||||
|
|
@ -94,11 +99,11 @@ detect_os () {
|
|||
# Returns the OS version
|
||||
detect_os_version () {
|
||||
os=$1
|
||||
if [[ "${os}" =~ ^(RedHat|Alma|Rocky)$ ]]; then
|
||||
if [[ "${os}" =~ ^(RedHat|Alma|Rocky|Fedora)$ ]]; then
|
||||
# Get the major version. /etc/redhat-release is used if /etc/os-release isn't available,
|
||||
# e.g., on CentOS/RHEL 6.
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
cat /etc/os-release | grep VERSION_ID= | sed -E 's/VERSION_ID="([0-9.]*)"/\1/' | cut -d '.' -f 1
|
||||
cat /etc/os-release | grep VERSION_ID= | sed -E 's/VERSION_ID="?([0-9.]*)"?/\1/' | cut -d '.' -f 1
|
||||
elif [[ -f /etc/redhat-release ]]; then
|
||||
cat /etc/redhat-release | sed -E 's/[^0-9]+([0-9.]+)[^0-9]*/\1/' | cut -d '.' -f 1
|
||||
fi
|
||||
|
|
@ -119,7 +124,7 @@ detect_os_version () {
|
|||
detect_installer_type () {
|
||||
os=$1
|
||||
case $os in
|
||||
"RedHat" | "CentOS" | "LEAP12" | "LEAP15" | "SLES12" | "SLES15" | "Amazon" | "Alma" | "Rocky")
|
||||
"RedHat" | "Fedora" | "CentOS" | "LEAP12" | "LEAP15" | "SLES12" | "SLES15" | "Amazon" | "Alma" | "Rocky")
|
||||
echo "rpm"
|
||||
;;
|
||||
"Ubuntu" | "Debian")
|
||||
|
|
@ -160,7 +165,7 @@ download_name () {
|
|||
;;
|
||||
esac
|
||||
case $os in
|
||||
"RedHat" | "CentOS" | "Amazon" | "Alma" | "Rocky")
|
||||
"RedHat" | "Fedora" | "CentOS" | "Amazon" | "Alma" | "Rocky")
|
||||
echo "R-${version}-1-1.${rpm_arch}.rpm"
|
||||
;;
|
||||
"Ubuntu" | "Debian")
|
||||
|
|
@ -185,6 +190,9 @@ download_url () {
|
|||
else
|
||||
|
||||
case $os in
|
||||
"Fedora")
|
||||
echo "${CDN_URL}/fedora-${ver}/pkgs/${name}"
|
||||
;;
|
||||
"RedHat" | "CentOS" | "Amazon" | "Alma" | "Rocky")
|
||||
if [ "${ver}" -ge 9 ]; then
|
||||
echo "${CDN_URL}/rhel-${ver}/pkgs/${name}"
|
||||
|
|
@ -304,7 +312,7 @@ install_rpm () {
|
|||
yes="-y"
|
||||
fi
|
||||
case $os in
|
||||
"RedHat" | "CentOS" | "Amazon" | "Alma" | "Rocky")
|
||||
"RedHat" | "Fedora" | "CentOS" | "Amazon" | "Alma" | "Rocky")
|
||||
if ! has_sudo "yum"; then
|
||||
echo "Must have sudo privileges to run yum"
|
||||
exit 1
|
||||
|
|
@ -333,6 +341,8 @@ install_pre () {
|
|||
ver=$2
|
||||
|
||||
case $os in
|
||||
"Fedora")
|
||||
;;
|
||||
"RedHat" | "CentOS" | "Alma" | "Rocky")
|
||||
install_epel "${os}" "${ver}"
|
||||
;;
|
||||
|
|
|
|||
Loading…
Reference in a new issue