Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/sanity-check
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-05-24 15:01:07 +0200
committerErich Eckner <git@eckner.net>2019-05-24 15:01:07 +0200
commitd1bd081fed69a8db0c95e8e8016e9ecaf251e48f (patch)
treedfc346c41b90e97eb75a5b23538cfc76a77838d8 /bin/sanity-check
parent423d088191e509adb7164c4dc48aac764fe158b5 (diff)
bin/sanity-check: add some verbosity, an rsync and an sftp check to "master-mirror-availability" test
Diffstat (limited to 'bin/sanity-check')
-rwxr-xr-xbin/sanity-check32
1 files changed, 31 insertions, 1 deletions
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 >/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)