fix vpn host naming
[distro-setup] / spamd-dns-fix
1 #!/bin/bash
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5
6 [[ $EUID == 0 ]]
7
8 # to deal with this bug until it\'s fixed
9 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741521
10 # I just happened to notice it in my journal.
11 str="dns: sendto() to \S\+ failed: Connection refused, failing over"
12 if journalctl --since=-9m --unit=spamassassin | \
13 grep "$str" &>/dev/null; then
14 echo "dns bug, restarting spamassassin"
15 systemctl restart spamassassin
16 fi