From 11a230f39cf1c30aaff4516e3a2616939b2d1133 Mon Sep 17 00:00:00 2001 From: Rodrigo de Avila Date: Mon, 25 Sep 2023 16:37:23 -0300 Subject: [PATCH] Comparing dates of both rsync servers --- run.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 06155de..77bb25a 100755 --- a/run.sh +++ b/run.sh @@ -10,7 +10,14 @@ if ! command -v yq >/dev/null 2>&1; then exit 1 fi -ORIGINAL_TIME=$(curl -fsSL "https://rsync.repo.almalinux.org/almalinux/TIME") +ATL_TIME=$(date -d "$(curl -sSq https://atl.rsync.repo.almalinux.org/almalinux/timestamp.txt)" +%s) +SEA_TIME=$(date -d "$(curl -sSq https://sea.rsync.repo.almalinux.org/almalinux/timestamp.txt)" +%s) + +if [ $ATL_TIME -ge $SEA_TIME ]; then + ORIGINAL_TIME=$ATL_TIME +else + ORIGINAL_TIME=$SEA_TIME +fi # Example: https://admin.fedoraproject.org/mirrormanager/propagation