From 2aafde0ac9eacbea36cd082cffee52a2baa8ba46 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 30 Oct 2020 01:41:42 -0400 Subject: [PATCH] mail fixes and add je.b8.nz --- bk-backup | 20 ++++++++++--------- .../vps/filesystem/etc/bind/named.conf.local | 5 +++++ mail-setup | 11 ++++++++-- mailtest-check | 20 ++++++++++++------- 4 files changed, 38 insertions(+), 18 deletions(-) diff --git a/bk-backup b/bk-backup index 1c3cc45..a71e77f 100755 --- a/bk-backup +++ b/bk-backup @@ -21,26 +21,28 @@ esac if $restore; then set -x - # for ncdir in /var/www/ncexpertpath /var/www/ncninja; do - # ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running - # rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir || ret=$? - # done + for ncdir in /var/www/ncexpertpath /var/www/ncninja; do + ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running + rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir || ret=$? + done rsync -ravi /p/bkbackup/rc/ root@$host:/m/rc exit 0 fi +ret=0 if [[ $HOSTNAME == $MAIL_HOST ]]; then mkdir -p /p/bkbackup for ncdir in /var/www/ncexpertpath /var/www/ncninja; do ncbase=${ncdir##*/} mkdir -p /p/bkbackup/$ncbase ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on - rsync -ra root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$? + rsync -rai --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$? ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --off - if (( $ret )) then - echo "$0: failed rsync $ncdir" - exit $ret + if (( $ret )); then + echo "$0: error: failed rsync $ncdir" + ret=1 fi done - rsync -ra root@$host:/m/rc /p/bkbackup + rsync -rai --delete root@$host:/m/rc /p/bkbackup fi +exit $ret diff --git a/machine_specific/vps/filesystem/etc/bind/named.conf.local b/machine_specific/vps/filesystem/etc/bind/named.conf.local index 0655556..62f38d2 100644 --- a/machine_specific/vps/filesystem/etc/bind/named.conf.local +++ b/machine_specific/vps/filesystem/etc/bind/named.conf.local @@ -43,3 +43,8 @@ zone "9.c.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa" { type master; file "/var/lib/bind/db.9.c.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa"; }; + +zone "d.9.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa" { +type master; +file "/var/lib/bind/db.d.9.0.f.1.f.1.0.8.a.b.0.1.0.0.2.ip6.arpa"; +}; diff --git a/mail-setup b/mail-setup index 33bfa66..046c8d9 100755 --- a/mail-setup +++ b/mail-setup @@ -9,6 +9,13 @@ # is being called when it shouldnt when rereunning we are probably # updating systemd config file that doesnt need to be or something. +# todo: mailtest-check failure on remote hosts is not going to alert me. +# sort that out. + +# todo: test out icedove + +# todo: test out nextcloud mail plugin + # background: I want to run exim in a network namespace so it can send # and receive through a vpn. This is needed so it can do ipv6, because # outside the namespace if we dont have ipv6, to send ipv6 through the @@ -1992,7 +1999,7 @@ EOF ;;& $MAIL_HOST) test_from=ian@iankelling.org - test_to="testignore@expertpathologyreview.com, testignore@je.bk.nz" + test_to="testignore@expertpathologyreview.com, testignore@je.b8.nz" cat >>/etc/cron.d/mailtest <