From 63a4a2deccc9fbf3711e33fb7d4c568d1ce0fa30 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Wed, 12 May 2021 02:22:06 +0300 Subject: [PATCH] 7.0.0-beta1 - Virtualmin 7 repos; Rocky and Alma support --- virtualmin-install.sh | 45 +++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index fa3aaec..d0e652b 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -18,14 +18,14 @@ # License and version SERIAL=GPL KEY=GPL -VER=6.2.4 -vm_version=6 +VER=7.0.0-beta1 +vm_version=7 # Currently supported systems: -supported=" CentOS/RHEL Linux 7, and 8 on x86_64 - Rocky Linux 8 on x86_64 - Debian 9, and 10 on i386 and amd64 - Ubuntu 16.04 LTS, 18.04 LTS, and 20.04 LTS on i386 and amd64" +supported=" CentOS/RHEL Linux 7 and 8 on x86_64 + Rocky and Alma Linux 8 on x86_64 + Ubuntu 20.04 LTS on i386 and amd64 + Debian 10 on i386 and amd64" log=/root/virtualmin-install.log skipyesno=0 @@ -329,7 +329,7 @@ log_fatal() { remove_virtualmin_release () { # shellcheck disable=SC2154 case "$os_type" in - "fedora" | "centos" | "rhel" | "amazon" | "rocky" ) + "fedora" | "centos" | "rhel" | "amazon" | "rocky" | "almalinux" ) run_ok "rpm -e virtualmin-release" "Removing virtualmin-release" ;; "debian" | "ubuntu" ) @@ -608,7 +608,7 @@ install_virtualmin_release () { # Grab virtualmin-release from the server log_debug "Configuring package manager for ${os_real} ${os_version}..." case "$os_type" in - rhel|centos|fedora|amazon|rocky) + rhel|centos|rocky|almalinux|fedora|amazon) case "$os_type" in rhel|centos) if [ "$os_major_version" -lt 7 ]; then @@ -616,7 +616,7 @@ install_virtualmin_release () { exit 1 fi ;; - rocky) + rocky|almalinux) if [ "$os_major_version" -lt 8 ]; then printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n" exit 1 @@ -629,13 +629,13 @@ install_virtualmin_release () { fi ;; ubuntu) - if [ "$os_version" != "16.04" ] && [ "$os_version" != "18.04" ] && [ "$os_version" != "20.04" ]; then + if [ "$os_version" != "18.04" ] && [ "$os_version" != "20.04" ]; then printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n" exit 1 fi ;; debian) - if [ "$os_major_version" -lt 9 ]; then + if [ "$os_major_version" -lt 10 ]; then printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n" exit 1 fi @@ -669,11 +669,7 @@ install_virtualmin_release () { install_group="yum -y --quiet groupinstall --setopt=group_package_types=mandatory,default" install_config_manager="yum-config-manager" fi - if [ "${os_type}" = "rocky" ]; then - download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}centos/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm" - else - download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}${os_type}/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm" - fi + download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}${os_type}/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm" run_ok "rpm -U --replacepkgs --quiet virtualmin-release-latest.noarch.rpm" "Installing virtualmin-release package" # XXX This weirdly only seems necessary on CentOS 8, but harmless # elsewhere. @@ -825,7 +821,7 @@ install_with_yum () { download "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" run_ok "rpm -U --replacepkgs --quiet epel-release-latest-7.noarch.rpm" "Installing EPEL 7 release package" # install extras from EPEL and SCL - elif [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ]; then + elif [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "almalinux" ]; then install_epel_release if [ "$os_major_version" -lt 8 ]; then # No SCL on CentOS 8 @@ -834,17 +830,18 @@ install_with_yum () { fi # Important Perl packages are now hidden in PowerTools repo - if [ "$os_major_version" -eq 8 ] && [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ]; then + if [ "$os_major_version" -eq 8 ] && [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "almalinux" ]; then # Detect PowerTools repo name - powertools="PowerTools" - centos_stream=$(dnf repolist all | grep "^powertools") - if [ ! -z "$centos_stream" ]; then + powertools=$(dnf repolist all | grep "^powertools") + if [ ! -z "$powertools" ]; then powertools="powertools" + else + powertools="PowerTools" fi run_ok "$install_config_manager --set-enabled $powertools" "Enabling PowerTools package repository" fi - # XXX This is so stupid. Why does yum insist on extra commands? + # XXX This is so stupid. Why does yum insists on extra commands? if [ "$os_major_version" -eq 7 ]; then run_ok "yum --quiet groups mark install $rhgroup" "Marking $rhgroup for install" run_ok "yum --quiet groups mark install $vmgroup" "Marking $vmgroup for install" @@ -892,8 +889,6 @@ install_scl_php () { run_ok "$install scl-utils" "Installing scl-utils" if [ "${os_type}" = "centos" ]; then run_ok "$install centos-release-scl" "Install Software Collections release package" - elif [ "${os_type}" = "rocky" ]; then - run_ok "$install rocky-release-scl" "Install Software Collections release package" elif [ "${os_type}" = "rhel" ]; then run_ok "$install_config_manager --enable rhel-server-rhscl-${os_major_version}-rpms" "Enabling Server Software Collection" fi @@ -958,7 +953,7 @@ disable_selinux () { # Changes that are specific to OS case "$os_type" in - "fedora" | "centos" | "rhel" | "amazon" | "rocky" ) + "fedora" | "centos" | "rhel" | "amazon" | "rocky" | "almalinux" ) disable_selinux ;; esac