diff options
-rwxr-xr-x | etc/centos-mirror.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/centos-mirror.sh b/etc/centos-mirror.sh index e8eb6a7..55961ce 100755 --- a/etc/centos-mirror.sh +++ b/etc/centos-mirror.sh @@ -1,7 +1,11 @@ #!/bin/sh +furl="http://mirror.centos.org/" +turl="${CENTOS_MIRROR-http://mirror.centos.org/}" for file in /etc/yum.repos.d/CentOS*.repo; do - sed -i .orig \ + sed -i.orig \ -e 's/^mirrorlist/#mirrorlist/' \ -e 's/^#baseurl/baseurl/' \ - $file + -e "s|${furl}|${turl}|" \ + "$file" + diff -u "${file}.orig" "${file}" done |