retry subscribing to RHN

This commit is contained in:
Juan Abia 2021-08-23 13:36:38 +02:00 committed by jrusz
parent 1e52484688
commit ee0af8b901
2 changed files with 11 additions and 5 deletions

View file

@ -52,9 +52,12 @@ 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"
for _ in {0..4}
do
sudo "$RHN_REGISTRATION_SCRIPT" && break
sleep 5
done
fi
# Distro version that this script is running on.

View file

@ -13,9 +13,12 @@ ARCH=$(uname -m)
# Register RHEL if we are provided with a registration script.
if [[ $ID == "rhel" && $VERSION_ID == "8.3" && -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
greenprint "🪙 Registering RHEL instance"
sudo subscription-manager remove --all
sudo chmod +x "$RHN_REGISTRATION_SCRIPT"
sudo "$RHN_REGISTRATION_SCRIPT"
sudo chmod +x "$RHN_REGISTRATION_SCRIPT"
for _ in {0..4}
do
sudo "$RHN_REGISTRATION_SCRIPT" && break
sleep 5
done
fi
# Mock configuration file to use for building RPMs.