summaryrefslogtreecommitdiff
path: root/portage-timestamp.sh
diff options
context:
space:
mode:
authordoc <doc@filenotfound.org>2025-10-01 20:35:47 +0000
committerdoc <doc@filenotfound.org>2025-10-01 20:35:47 +0000
commit772152a5810aa8c4e03cf167381aadc4ec00499f (patch)
treeba9418142f88622da878d9a3483c5da2da3e5c83 /portage-timestamp.sh
parent13eb2d51c7284472efabc278bf9b7ec0b8575e47 (diff)
mirror scriptsHEADmaster
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