Skip to content

Instantly share code, notes, and snippets.

@stbenjam
Created January 21, 2015 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stbenjam/67555b983335d50bfa6d to your computer and use it in GitHub Desktop.
Save stbenjam/67555b983335d50bfa6d to your computer and use it in GitHub Desktop.
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