diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/sanity-check | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/bin/sanity-check b/bin/sanity-check index df0b43c..df273fa 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -128,13 +128,40 @@ touch "${tmp_dir}/messages" trap 'finish' EXIT if [ $# -eq 0 ]; then - set -- git-repositories build-list mysql repos package-database track-state + set -- git-repositories build-list mysql master-mirror-availability repos package-database track-state fi while [ $# -gt 0 ]; do case "$1" in + master-mirror-availability) + + for host in $( + printf '%s\n' \ + "${master_mirror_sftp_command}" \ + "${master_mirror_rsync_directory}" | \ + sed ' + s,^.*@\([^:/@]\+\)\([:/].*\)\?$,\1, + t + d + ' | \ + sort -u + ); do + if ! ping -c1 "${host}" >/dev/null 2>&1; then + if [ ${silence} -le 1 ]; then + printf '\nThe master mirror %s cannot be reached.\n' \ + "${host}" | \ + tee -a "${tmp_dir}/messages" >&2 + fi + i_am_insane + # if the master mirror cannot be reached, further tests do not make any sense + set -- + fi + done + + ;; + git-repositories) [ ${silence} -gt 0 ] || \ |