From e93a488af3a47f059a407dd797d48459d3f639ef Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 22 Dec 2021 11:58:12 -0500 Subject: [PATCH] some minor fixes --- mail-setup | 60 ++++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 47 deletions(-) diff --git a/mail-setup b/mail-setup index 47f5990..6efc3e3 100755 --- a/mail-setup +++ b/mail-setup @@ -305,7 +305,7 @@ soff () { fi done } -sre () { +sre() { for service; do m systemctl restart $service m systemctl enable $service; @@ -462,11 +462,13 @@ EOF # * mail vpn config -vpnser=mailvpn.service +# old. +#vpnser=mailvpn.service vpnser=wg-quick@wgmail.service case $HOSTNAME in $MAIL_HOST) + rsync -aiSAX --chown=root:root --chmod=g-s /p/c/filesystem/etc/wireguard/ /etc/wireguard bindpaths="/etc/127.0.0.1-resolv:/run/systemd/resolve /etc/basic-nsswitch:/etc/resolved-nsswitch:norbind" ;;& bk) @@ -2548,6 +2550,7 @@ EOF echo|i /etc/exim4/conf.d/router/190_exim4-config_fsfsmarthost echo|i /etc/exim4/conf.d/rcpt_local_acl echo|i /etc/exim4/conf.d/router/890_backup_copy + echo|i /etc/exim4/conf.d/main/000_local-nn if $bhost_t; then @@ -2753,15 +2756,9 @@ case $HOSTNAME in ;;& $MAIL_HOST|bk) sstart mailnn mailnnroute - # If these have changes, id rather manually restart it, id rather - # not restart and cause temporary errors - if $reload; then - sre $vpnser - else - sstart $vpnser - fi ;;& $MAIL_HOST) + # we use dns to start wg if $reload; then sre unbound else @@ -2769,6 +2766,13 @@ case $HOSTNAME in fi ;;& $MAIL_HOST|bk) + # If these have changes, id rather manually restart it, id rather + # not restart and cause temporary errors + if $reload; then + sre $vpnser + else + sstart $vpnser + fi if ! systemctl is-active clamav-daemon >/dev/null; then sstart clamav-daemon # note, this will cause paniclog entries because it takes like 45 @@ -2911,44 +2915,6 @@ done # Multiple user names need to be separated by spaces. # Root and postmaster mail recipient: -# duplicated in brc2 -bum() { - local cur host - host=$1 - (( $# == 1 )) || return 1 - cur="$(awk '$2 == "/bu/mnt" {print $1}' /proc/mounts)" - if [[ $cur ]]; then - if [[ $cur == "$host:/bu/md" ]]; then - return 0 - else - fusermount -u /bu/mnt - fi - fi - m sshfs bu@$host:/bu/home/md /bu/mnt -o reconnect,ServerAliveInterval=20,ServerAliveCountMax=30 -o allow_other -} -bu() { - if mountpoint -q /bu/mnt; then - if ! timeout -s 9 10 fusermount -u /bu/mnt; then - fusermount -zu /bu/mnt - fi - fi -} - -case $HOSTNAME in - $MAIL_HOST) - case $HOSTNAME in - kw) bum x3 ;; - x3) bum kw ;; - kd|sy) bum x2 ;; - x2) bum kd ;; - esac - ;; - *) - bu - ;; -esac - - m exit 0 : -- 2.30.2