Created
August 12, 2016 05:25
-
-
Save mjs/90ac9f9d3dde4f511f02c0c4cbc4da00 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
#!/usr/bin/perl | |
$mirror = "nz.archive.ubuntu.com"; | |
#$mirror = "us.archive.ubuntu.com"; | |
# For Cape Town | |
#$mirror = "ubuntu.saix.net/ubuntu-archive"; | |
$| = 1; | |
while (<>) { | |
@line = split; | |
$_ = $line[0]; | |
if (m/^http:\/\/((?:[a-z0-9]+\.)?archive\.ubuntu\.com)\/(.*)/ && | |
$1 ne $mirror) { | |
print "http://" . $mirror . "/" . $2 . "\n"; | |
} else { | |
print $_ . "\n"; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment