Skip to content

Commit

Permalink
use repo_id for url replacement
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Kolberg <[email protected]>
  • Loading branch information
amdprophet committed Oct 25, 2024
1 parent 1859e27 commit e897f59
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions install-script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e897f59

Please sign in to comment.