summaryrefslogtreecommitdiff
path: root/portage-timestamp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'portage-timestamp.sh')
-rwxr-xr-xportage-timestamp.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/portage-timestamp.sh b/portage-timestamp.sh
new file mode 100755
index 0000000..cbe006d
--- /dev/null
+++ b/portage-timestamp.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# try-portage-timestamp.sh
+# Loop through Gentoo rsync mirrors and grab timestamp.chk
+
+MIRRORS=(
+ rsync://rsync.gentoo.org/gentoo-portage/metadata/timestamp.chk
+ rsync://rsync1.de.gentoo.org/gentoo-portage/metadata/timestamp.chk
+ rsync://rsync.uk.gentoo.org/gentoo-portage/metadata/timestamp.chk
+ rsync://rsync.fr.gentoo.org/gentoo-portage/metadata/timestamp.chk
+ rsync://rsync.us.gentoo.org/gentoo-portage/metadata/timestamp.chk
+)
+
+for SRC in "${MIRRORS[@]}"; do
+ echo "Trying $SRC ..."
+ OUT=$(rsync --no-motd "$SRC" /dev/stdout 2>/dev/null)
+ if [[ -n "$OUT" ]]; then
+ echo ">>> Success from $SRC"
+ echo "$OUT"
+ exit 0
+ fi
+done
+
+echo "!!! No mirror returned a timestamp.chk"
+exit 1