Created
January 21, 2015 21:26
-
-
Save stbenjam/67555b983335d50bfa6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
major=$(facter operatingsystemmajrelease) | |
repos=$(subscription-manager repos | grep 'Repo ID' | grep -v "rhel-" | cut -d: -f2) | |
for repo in $repos; do | |
echo $repo | grep -q "$major-server" | |
retval=$? | |
if [[ $retval != 0 ]] | |
then | |
subscription-manager repos --disable $repo | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment