From 38470c2340da4cfa2a46271d83a7b05777628460 Mon Sep 17 00:00:00 2001 From: Ricardo Martins Date: Thu, 17 Dec 2015 14:23:50 +0000 Subject: [PATCH] mkpackage: added primary mirror (OceanScan-MST server). --- mkpackage.bash | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mkpackage.bash b/mkpackage.bash index f6527fa..a5a360f 100755 --- a/mkpackage.bash +++ b/mkpackage.bash @@ -56,6 +56,7 @@ md5sum_tool() download() { n=0; while [ -n "${url[$n]}" ]; do + u="${url[$n]}" s="${md5[$n]}" file=$(basename "$u") @@ -69,10 +70,16 @@ download() fi fi - download_tool "$u" "$cfg_dir_downloads/$file" + # First try OceanScan-MST mirror. + omst_url="http://www.omst.pt/glued/$(basename $u)" + download_tool "$omst_url" "$cfg_dir_downloads/$file" if [ $? -ne 0 ]; then - echo "ERROR: download failed" - exit 1 + # On failure try upstream URL. + download_tool "$u" "$cfg_dir_downloads/$file" + if [ $? -ne 0 ]; then + echo "ERROR: download failed" + exit 1 + fi fi md5="$(md5sum_tool "$cfg_dir_downloads/$file")"