remove all rhn subscriptions before registering a new one

This commit is contained in:
Juan Abia 2021-08-23 13:36:38 +02:00 committed by Alexander Todorov
parent b782ecaf1f
commit 1e52484688
2 changed files with 2 additions and 0 deletions

View file

@ -52,6 +52,7 @@ ARCH=$(uname -m)
if [[ $ID == "rhel" && $VERSION_ID == "8.3" && -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
greenprint "Registering RHEL"
sudo subscription-manager remove --all
sudo chmod +x "$RHN_REGISTRATION_SCRIPT"
sudo "$RHN_REGISTRATION_SCRIPT"
fi