X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mail-setup;h=30c987f457ec1bfb895071300276f2614420b0cf;hb=72c18f3a6a7f1ed0ca16af654a1f804ab96e1ff9;hp=f17b3afe81d5b79f2e203f6b0a92116e0dc630ae;hpb=d6def754cd241538c61456536b52ee51cbd85b42;p=distro-setup diff --git a/mail-setup b/mail-setup index f17b3af..30c987f 100755 --- a/mail-setup +++ b/mail-setup @@ -3,6 +3,10 @@ # Copyright (C) 2019 Ian Kelling # SPDX-License-Identifier: AGPL-3.0-or-later + +# shellcheck disable=SC2254 # makes for a lot of unneeded quotes + + # perusing through /el/mainlog without test messages: # &!testignore|jtuttle| # @@ -3422,14 +3426,20 @@ if $reload; then m systemctl daemon-reload fi -# checking bhost_t is redundant, but could help us catch errors. -if $bhost_t || [[ -e /etc/wireguard/wghole.conf ]]; then - # todo: in mail-setup, we have a static list of backup hosts, not *y - m systemctl --now enable wg-quick@wghole +# optimization, this only needs to run once. +if [[ ! -e /sys/class/net/wghole ]]; then + # checking bhost_t is redundant, but could help us catch errors. + if $bhost_t || [[ -e /etc/wireguard/wghole.conf ]]; then + # todo: in mail-setup, we have a static list of backup hosts, not *y + m systemctl --now enable wg-quick@wghole + fi fi -sysd-prom-fail-install epanicclean -m systemctl --now enable epanicclean +# optimization, this only needs to be run once +if [[ ! -e /var/lib/prometheus/node-exporter/exim_paniclog.prom ]]; then + sysd-prom-fail-install epanicclean + m systemctl --now enable epanicclean +fi case $HOSTNAME in je) @@ -3440,8 +3450,11 @@ case $HOSTNAME in ;; esac -m /a/bin/ds/mail-cert-cron -1 -sre mailcert.timer +# optimization, this only needs to run once. +if [[ ! -e /etc/exim4/fullchain.pem ]]; then + m /a/bin/ds/mail-cert-cron -1 + m systemctl --now enable mailcert.timer +fi case $HOSTNAME in $MAIL_HOST|bk)