|
|
@ -42,19 +42,19 @@ enable_disable_repo(){
|
|
|
|
crb_repo=$(dnf repolist --all | grep -i -e crb -e powertools -e codeready | grep -v -i -e debug -e source -e eus -e virt | awk '{print $1}')
|
|
|
|
crb_repo=$(dnf repolist --all | grep -i -e crb -e powertools -e codeready | grep -v -i -e debug -e source -e eus -e virt | awk '{print $1}')
|
|
|
|
|
|
|
|
|
|
|
|
# Determine if we are on RHEL or not, then do the correct steps
|
|
|
|
# Determine if we are on RHEL or not, then do the correct steps
|
|
|
|
if echo "${crb_repo}" | grep -q "codeready" ; then
|
|
|
|
source /etc/os-release
|
|
|
|
# Only RHEL has a repo with codeready in it, use subcription-manager
|
|
|
|
if [[ "${NAME}" =~ "Red Hat" ]] ; then
|
|
|
|
subscription-manager repos ${command} ${crb_repo}
|
|
|
|
subscription-manager repos ${command} ${crb_repo}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
# Determine if dnf-command(config-manager) is installed
|
|
|
|
# Determine if dnf-command(config-manager) is installed
|
|
|
|
if ! rpm -q --whatprovides 'dnf-command(config-manager)' > /dev/null 2>&1 ; then
|
|
|
|
if ! rpm -q --whatprovides 'dnf-command(config-manager)' > /dev/null 2>&1 ; then
|
|
|
|
echo "Error: Please run: dnf install 'dnf-command(config-manager)'" >&2
|
|
|
|
echo "Error: Please run: dnf install 'dnf-command(config-manager)'" >&2
|
|
|
|
echo " before trying to enable/disable the CRB repo." >&2
|
|
|
|
echo " before trying to enable/disable the CRB repo." >&2
|
|
|
|
echo "Aborting"'!' >&2
|
|
|
|
echo "Aborting"'!' >&2
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Everything else uses dnf config-manager
|
|
|
|
# Everything else uses dnf config-manager
|
|
|
|
dnf config-manager ${command} ${crb_repo}
|
|
|
|
dnf config-manager ${command} ${crb_repo}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|