diff --git a/install-script/install.sh b/install-script/install.sh index 53e0b961..420e3da1 100755 --- a/install-script/install.sh +++ b/install-script/install.sh @@ -971,21 +971,29 @@ function install_linux_package() { yum | dnf) curl -s "${base_url}/script.rpm.sh" | bash # Change packagecloud.io to packages.sumologic.com in the repo's configuration - sed -i 's/packagecloud.io/packages.sumologic.com/g' /etc/yum.repos.d/sumologic_stable.repo + sed -i 's/packagecloud.io/packages.sumologic.com/g' /etc/yum.repos.d/${repo_id}.repo yum --quiet --disablerepo="*" --enablerepo="${repo_id}" -y update - yum install --quiet -y "${package_name}-${VERSION}" - ;; - apt-get) + local package_str package_str="${package_name}" if [[ -n "${VERSION}" ]]; then - package_str="${package_str}=${VERSION}" + package_str="${package_str}-${VERSION}" fi echo "Installing ${package_str}" + yum install --quiet -y "${package_str}" + ;; + apt-get) curl -s "${base_url}/script.deb.sh" | bash # Change packagecloud.io to packages.sumologic.com in the repo's configuration - sed -i 's/packagecloud.io/packages.sumologic.com/g' /etc/apt/sources.list.d/sumologic_stable.list + sed -i 's/packagecloud.io/packages.sumologic.com/g' /etc/apt/sources.list.d/${repo_id}.list apt-get update --quiet -y -o Dir::Etc::sourcelist="sources.list.d/${repo_id}" + + local package_str + package_str="${package_name}" + if [[ -n "${VERSION}" ]]; then + package_str="${package_str}=${VERSION}" + fi + echo "Installing ${package_str}" apt-get install --quiet -y "${package_str}" ;; esac