#!/bin/bash # Copyright (C) 2019 Ian Kelling # SPDX-License-Identifier: AGPL-3.0-or-later if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi source /a/bin/errhandle/err shopt -s nullglob shopt -s dotglob for h in tp.b8.nz vpn1 x2 x3.b8.nz frodo.b8.nz kd.b8.nz kw iankelling.org; do if [[ $HOSTNAME == "${h%%.*}" ]]; then continue fi if c=$(timeout 1 ssh root@$h /b/ds/check-mailq 2>/dev/null ) && [[ $c ]]; then echo q:$h=$c fi done