diff options
author | doc <doc@filenotfound.org> | 2025-10-01 20:35:47 +0000 |
---|---|---|
committer | doc <doc@filenotfound.org> | 2025-10-01 20:35:47 +0000 |
commit | 772152a5810aa8c4e03cf167381aadc4ec00499f (patch) | |
tree | ba9418142f88622da878d9a3483c5da2da3e5c83 /lastsyncarch.sh | |
parent | 13eb2d51c7284472efabc278bf9b7ec0b8575e47 (diff) |
Diffstat (limited to 'lastsyncarch.sh')
-rwxr-xr-x | lastsyncarch.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lastsyncarch.sh b/lastsyncarch.sh new file mode 100755 index 0000000..499fb95 --- /dev/null +++ b/lastsyncarch.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# check-arch-lastupdate.sh +# Compare local Arch mirror's lastupdate with upstream + +LOCAL_URL="https://stygian.failzero.net/mirror/archlinux/lastupdate" +UPSTREAM_URL="https:///mirror.csclub.uwaterloo.ca/archlinux/lastupdate" + +# Grab values +local_val=$(curl -s "$LOCAL_URL") +upstream_val=$(curl -s "$UPSTREAM_URL") + +# Convert to human-readable +local_hr=$(date -d @"$local_val" 2>/dev/null) +upstream_hr=$(date -d @"$upstream_val" 2>/dev/null) + +echo "=== Arch Lastupdate Check ===" +echo "Local: $local_val ($local_hr)" +echo "Upstream: $upstream_val ($upstream_hr)" + +# Compare +if [[ "$local_val" == "$upstream_val" ]]; then + echo "[OK] Mirror is up to date." +else + echo "[WARN] Mirror is out of sync!" +fi |