aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2015-10-04 23:11:56 +0200
committerAlex Legler <alex@a3li.li>2015-10-04 23:11:56 +0200
commitcf3a50598652c1ba49933b247b46284bf4e283d0 (patch)
tree953841ca819a5d352683322f11b92c509ff24248 /bin/update-mirrors.sh
parentAdapt to pgo updates (diff)
downloadwww-cf3a50598652c1ba49933b247b46284bf4e283d0.tar.gz
www-cf3a50598652c1ba49933b247b46284bf4e283d0.tar.bz2
www-cf3a50598652c1ba49933b247b46284bf4e283d0.zip
Keep data files when updates cannot be fetched
Diffstat (limited to 'bin/update-mirrors.sh')
-rwxr-xr-xbin/update-mirrors.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/update-mirrors.sh b/bin/update-mirrors.sh
index d74dbaf..0f63bf9 100755
--- a/bin/update-mirrors.sh
+++ b/bin/update-mirrors.sh
@@ -1,6 +1,8 @@
#!/bin/bash
echo -n 'Updating mirror information...'
-wget 'https://api.gentoo.org/mirrors/distfiles.xml' -O _data/mirrors-distfiles.xml 2>/dev/null
-wget 'https://api.gentoo.org/mirrors/rsync.xml' -O _data/mirrors-rsync.xml 2>/dev/null
-echo 'done.' \ No newline at end of file
+wget 'https://api.gentoo.org/mirrors/distfiles.xml' -O _data/mirrors-distfiles.xml.tmp 2>/dev/null
+[ $? -eq 0 ] && mv _data/mirrors-distfiles.xml.tmp _data/mirrors-distfiles.xml
+wget 'https://api.gentoo.org/mirrors/rsync.xml' -O _data/mirrors-rsync.xml.tmp 2>/dev/null
+[ $? -eq 0 ] && mv _data/mirrors-rsync.xml.tmp _data/mirrors-rsync.xml
+echo 'done.'