standarize restart delays, check that exim is running on remote hosts
[distro-setup] / check-mailq
1 #!/bin/bash
2 # Copyright (C) 2019 Ian Kelling
3 # SPDX-License-Identifier: AGPL-3.0-or-later
4
5 if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
6
7 set -eE -o pipefail
8 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
9
10 if ! systemctl is-active --quiet exim4; then
11 systemctl status exim4
12 fi
13 qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
14 if [[ $qlen != 0 ]]; then
15 printf "%s" $qlen
16 fi
17
18 find /var/mail -type f \! -empty -print -quit