summaryrefslogtreecommitdiff
path: root/lastsyncarch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lastsyncarch.sh')
-rwxr-xr-xlastsyncarch.sh25
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