From fa5d26af03df580bdecc158fe34b0ac200c5aea5 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 10 Oct 2014 15:31:39 -0300 Subject: [PATCH] proxy.sh: make repository editing more reliable --- proxy.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy.sh b/proxy.sh index 37dc261..5619ca4 100755 --- a/proxy.sh +++ b/proxy.sh @@ -25,7 +25,10 @@ if test -f /etc/yum.conf; then rm -f /etc/yum/pluginconf.d/fastestmirror.conf - sed -i -e 's/^#baseurl/baseurl/; s/^mirrorlist=/#mirrorlist-/' /etc/yum.repos.d/CentOS-*.repo + repofiles=$(grep -rl '^#baseurl' /etc/yum.repos.d) + if [ -n "$repofiles" ]; then + sed -i -e 's/^#baseurl/baseurl/; s/^mirrorlist=/#mirrorlist-/' $repofiles + fi if [ ! -f /var/tmp/yum-clean.stamp ]; then pgrep -f yum || yum clean all || true -- libgit2 0.21.2