Commit fa5d26af03df580bdecc158fe34b0ac200c5aea5
1 parent
9749cb50
Exists in
master
and in
90 other branches
proxy.sh: make repository editing more reliable
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
proxy.sh
@@ -25,7 +25,10 @@ if test -f /etc/yum.conf; then | @@ -25,7 +25,10 @@ if test -f /etc/yum.conf; then | ||
25 | 25 | ||
26 | rm -f /etc/yum/pluginconf.d/fastestmirror.conf | 26 | rm -f /etc/yum/pluginconf.d/fastestmirror.conf |
27 | 27 | ||
28 | - sed -i -e 's/^#baseurl/baseurl/; s/^mirrorlist=/#mirrorlist-/' /etc/yum.repos.d/CentOS-*.repo | 28 | + repofiles=$(grep -rl '^#baseurl' /etc/yum.repos.d) |
29 | + if [ -n "$repofiles" ]; then | ||
30 | + sed -i -e 's/^#baseurl/baseurl/; s/^mirrorlist=/#mirrorlist-/' $repofiles | ||
31 | + fi | ||
29 | 32 | ||
30 | if [ ! -f /var/tmp/yum-clean.stamp ]; then | 33 | if [ ! -f /var/tmp/yum-clean.stamp ]; then |
31 | pgrep -f yum || yum clean all || true | 34 | pgrep -f yum || yum clean all || true |