openbsd_check_mirrors.sh - randomcrap - random crap programs of varying quality
(HTM) git clone git://git.codemadness.org/randomcrap
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
openbsd_check_mirrors.sh (525B)
---
1 #!/bin/sh
2 # Script to check the OpenBSD mirrors if syspatches are up-to-date.
3 # only checks if it can connect and the file is found using HTTP HEAD.
4
5 checkfile="syspatch/7.1/amd64/syspatch71-002_ipsec.tgz"
6
7 curl -f -m 15 -s "https://ftplist1.openbsd.org/cgi-bin/ftplist.cgi?dbversion=1" | \
8 cut -f 1 -d ' ' | grep '^[a-z]*://' | sort | uniq | \
9 while read -r mirror; do
10 url="${mirror}/${checkfile}"
11 if curl -f -m 15 -s -I "${url}" 2>/dev/null >/dev/null; then
12 echo "OK: ${url}"
13 else
14 echo "FAIL: ${url}" >&2
15 fi
16 done