From d1bd081fed69a8db0c95e8e8016e9ecaf251e48f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 24 May 2019 15:01:07 +0200 Subject: bin/sanity-check: add some verbosity, an rsync and an sftp check to "master-mirror-availability" test --- bin/sanity-check | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'bin/sanity-check') diff --git a/bin/sanity-check b/bin/sanity-check index df273fa..e93a157 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -137,6 +137,10 @@ while [ $# -gt 0 ]; do master-mirror-availability) + [ ${silence} -gt 0 ] || \ + printf 'checking if master mirror can be reached ...' | \ + tee -a "${tmp_dir}/messages" >&2 + for host in $( printf '%s\n' \ "${master_mirror_sftp_command}" \ @@ -150,7 +154,7 @@ while [ $# -gt 0 ]; do ); do if ! ping -c1 "${host}" >/dev/null 2>&1; then if [ ${silence} -le 1 ]; then - printf '\nThe master mirror %s cannot be reached.\n' \ + printf '\nThe master mirror %s cannot be pinged.\n' \ "${host}" | \ tee -a "${tmp_dir}/messages" >&2 fi @@ -160,6 +164,32 @@ while [ $# -gt 0 ]; do fi done + if ! ${master_mirror_rsync_command} ${master_mirror_rsync_directory} >/dev/null 2>&1; then + if [ ${silence} -le 1 ]; then + printf '\nThe master mirror %s cannot be reached via rsync.\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 + + if ! ${master_mirror_sftp_command} /dev/null 2>&1; then + if [ ${silence} -le 1 ]; then + printf '\nThe master mirror %s cannot be reached via sftp.\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 + + [ ${silence} -gt 0 ] || \ + echo ' passed.' | \ + tee -a "${tmp_dir}/messages" >&2 + ;; git-repositories) -- cgit v1.2.3-54-g00ecf