Skip to content

Commit

Permalink
Merge pull request #147 from e-minguez/or_and
Browse files Browse the repository at this point in the history
Check if subscribed and proper repos
  • Loading branch information
oglok authored Jul 3, 2021
2 parents 07eb36a + e711417 commit 2a74a2f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@ get_arch() {
ARCH=$(uname -m)
}

# If RHEL, use subscription manager to register
# If RHEL, use subscription-manager to register
register_subs() {
sudo subscription-manager register --auto-attach ||
sudo subscription-manager repos --enable=rhocp-4.7-for-rhel-8-x86_64-rpms
REPO="rhocp-4.7-for-rhel-8-x86_64-rpms"
# Check subscription status and register if not
STATUS=$(sudo subscription-manager status | awk '/Overall Status/ { print $3 }')
if [[ $STATUS != "Current" ]]
then
sudo subscription-manager register --auto-attach
fi

# Check if already subscribed to the proper repository
if ! sudo subscription-manager repos --list-enabled | grep -q ${REPO}
then
sudo subscription-manager repos --enable=${REPO}
fi
}

# Apply SElinux policies
Expand Down

0 comments on commit 2a74a2f

Please sign in to comment.