system-status _
}
+alerts() {
+ find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f
+}
+ralerts() { # remote alerts
+ local ret shell
+ # this list is duplicated in check-remote-mailqs
+ for h in bk je li frodo kwwg x3wg x2wg kdwg sywg; do
+ echo $h:
+ shell="ssh $h"
+ if [[ $HOSTNAME == "${h%wg}" ]]; then
+ shell=
+ fi
+ ret=0
+ $shell find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f || ret=$?
+ if (( ret )); then
+ echo ret:$ret
+ fi
+ done
+}
+
ap() {
# pushd in case current directory has an ansible.cfg file
pushd /a/xans >/dev/null
shopt -s nullglob
shopt -s dotglob
-for h in bk je li frodo kwwg x3wg x2wg kdwg; do
+# this list duplicated in brc2 ralerts
+for h in bk je li frodo kwwg x3wg x2wg kdwg sywg; do
statedir=/b/bash_unpublished/mailq-state
statefile=$statedir/$h
[[ -d $statedir ]] || continue
#!/bin/bash
+
+time_arg="-ctime +4"
+case $1 in
+ now)
+ time_arg=
+ ;;
+esac
+
if [[ ! -e /dev/shm/iank-status ]]; then
exit 0
fi
if ! resolvectl dnsovertls tunfsf &>/dev/null; then
- echo failed resolvectl dnsovertls tunfsf. rerunning:
- resolvectl dnsovertls tunfsf
+ ## most likely the interface doesnt exist. if we wanted verbose output, then:
+ # echo failed resolvectl dnsovertls tunfsf. rerunning:
+ # resolvectl dnsovertls tunfsf ||:
exit 0
fi
read _ link _ < <(resolvectl dnsovertls tunfsf)
rsync --server -OtpRe.LsfxC . /usr/local
/usr/local/bin/mail-backup-clean
/usr/local/bin/check-mailq
+find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f
EOF
allow=false
getspamdpid() {
if [[ ! $spamdpid || ! -d /proc/$spamdpid ]]; then
- spamdpid=$(systemctl status spamassassin| sed -n '/^ *Main PID:/s/[^0-9]//gp')
+ spamdpid=$(systemctl status spamassassin| sed -n '/^ *Main PID:/s/[^0-9]//gp' ||:)
fi
}
getspamdpid
e spamdpid: $spamdpid
if [[ ! $spamdpid ]]; then
- echo $HOSTNAME mailtest spamd pid not found
+ echo $HOSTNAME mailtest spamd pid not found. systemctl status spamassassin:
+ systemctl status spamassassin
fi
tmpfile=$(mktemp)
for folder in ${folders[@]}; do