Thanks Vladimir, I can pull out the host from this using: preferred=$(curl -s 'http://www.apache.org/dyn/closer.cgi?as_json=1' | grep "preferred" | cut -d ':' -f3 | cut -d'/' -f3)
But there's another problem: The mirrors only seem to host the latest version of JMeter. Older versions, as far as I can tell, only live on archive.apache.org <http://archive.apache.org/> or www.apache.org <http://www.apache.org/>. I know that these servers are not meant to serve binaries like this but I keep ending coming back to using them. I thought about trying to host older versions myself but it will break each time a new release is made. Another solution I considered was only allowing the latest version to be used but that would mean an uncontrolled upgrade for everyone each time a release is made, which isn't correct. > On 4 Apr 2016, at 13:34, Vladimir Sitnikov <[email protected]> > wrote: > > curl 'http://www.apache.org/dyn/closer.cgi?as_json=1' > gives something like > { > "backup": [ "http://www-eu.apache.org/dist/", > "http://www-us.apache.org/dist/" ], > "cca2": "ru", > "http": [ "http://apache-mirror.rbc.ru/pub/apache/" ], > "path_info": "", > "preferred": "http://apache-mirror.rbc.ru/pub/apache/" > } > > Then you grep for preferred somehow, then construct the proper URL. > > Does that work for you? > Vladimir >
