various fixes
authorIan Kelling <ian@iankelling.org>
Fri, 2 Aug 2019 03:19:35 +0000 (23:19 -0400)
committerIan Kelling <ian@iankelling.org>
Fri, 2 Aug 2019 03:19:35 +0000 (23:19 -0400)
brc
mail-setup
subdir_files/.gnupg/gpg.conf
switch-mail-host
system-status

diff --git a/brc b/brc
index 5fb46ac450959aa36d96908568d25e7fa5c7b104..1d6e833471c67ee4eb472a2f24957d215504aeb3 100644 (file)
--- a/brc
+++ b/brc
@@ -652,7 +652,10 @@ envload() { # load environment from a previous: export > file
 
 # mail related
 etail() {
-  sudo tail -F /var/log/exim4/mainlog -n 50
+  tail -F /var/log/exim4/mainlog -n 200
+}
+eless() {
+  less /var/log/exim4/mainlog
 }
 
 f() {
@@ -1441,7 +1444,7 @@ q() { # start / launch a program in the backround and redir output to null
 }
 
 r() {
-  histappend -a
+  history -a # save history
   exit "$@"
   # i had this redir, not sure why
 #  exit "$@" 2>/dev/null
index c313c46da685e41f4381bcadbb9cee071df3be50..b97f3b929a5fd4f1f16105d9c8bcadf8c66951e5 100755 (executable)
@@ -15,7 +15,8 @@ set -x
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# todo: make quick backups of maildir, or deliver to multiple hosts.
+# TODO: copy dkim keys from within this file. its now done in conflink.
+# TODO: fix dkim key to b chmod 640, group Debian-exim
 
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
@@ -340,6 +341,7 @@ EOF
 #### begin mail cert setup ###
 f=/usr/local/bin/mail-cert-cron
 cat >$f <<'EOF'
+#!/bin/bash
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 
@@ -396,6 +398,11 @@ systemctl start mailcert
 systemctl restart mailcert.timer
 systemctl enable mailcert.timer
 
+# This symlink is only here to so I can use the
+# fsf mailman ansible role and trick its cert script
+# into doing nothing.
+/a/exe/lnf -T /etc/exim4/exim.crt /etc/letsencrypt/live/$(hostname -f)/fullchain.pem
+
 ##### end mailcert setup #####
 
 # comon stuff
index 2e437a3a27a1686ef678c795a5a87687ebc32a65..1f8d6f727cc9e0eceeea3c9dafb4058f90f3d9a6 100644 (file)
@@ -39,12 +39,12 @@ default-key B125F60B7B287FF6A2B7DF8F170AF0E2954295DF
 # DO NOT USE THIS ONE.
 #keyserver hkp://pool.sks-keyservers.net
 
-keyserver hkp://keys.openpgp.org
+#keyserver hkp://keys.openpgp.org
 #keyserver hkp://pgp.mit.edu
 #keyserver hkp://keyserver.pgp.com
 #keyserver hkp://ipv4.pool.sks-keyservers.net
 #keyserver hkp://keys.gnupg.net
-
+keyserver hkp://keyring.debian.org
 
 # more secure, but had problems with my gpg version
 #keyserver hkps://hkps.pool.sks-keyservers.net
index 32642240dd17cf4e4978accfa2f4a27ea92cc14c..2d74ceb824d69ac62089b5491abdfad4db0424ba 100644 (file)
@@ -24,7 +24,7 @@ EOF
 
 update_wrt=true # default
 temp=$(getopt -l help owh "$@") || usage 1
-mp_args=
+mp_args="-m /o,/q,/a"
 eval set -- "$temp"
 while true; do
   case $1 in
index f39f03176fdae290843d45ea851641ade5b21056..c92bc9a9656583b253d5619f8d97b9ddeffe6260 100755 (executable)
@@ -6,15 +6,13 @@
 
 if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
 
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-
+source /a/bin/errhandle/err
 status_file=/dev/shm/iank-status
 
 shopt -s nullglob
 shopt -s dotglob
 
-lo() { /usr/local/bin/log-once -1 "$@"; }
+lo() { /usr/local/bin/log-once "$@"; }
 
 write-status() {
   chars=()
@@ -26,7 +24,7 @@ write-status() {
   glob=(/m/md/bounces/new/*)
   if [[ -e $glob ]]; then
     chars+=("BOUNCE!")
-    lo bounce "message in /m/md/bounces/new"
+    lo -1 bounce "message in /m/md/bounces/new"
   fi
   glob=(/m/md/alerts/new/* /m/md/alerts/cur/*)
   if [[ -e $glob ]]; then
@@ -34,17 +32,17 @@ write-status() {
   fi
   if [[ -e /nocow/user/mailtest-failure ]]; then
     chars+=("MAILPING!")
-    lo mailping "mailtest-check didnt see mail from send-test-forward"
   fi
   if [[ -s /var/log/exim4/paniclog ]]; then
     chars+=("PANIC!")
-    tail /var/log/exim4/paniclog | lo paniclog
+    tail /var/log/exim4/paniclog | lo -1 paniclog
   fi
 
   source /a/bin/bash_unpublished/source-state
   if [[ $MAIL_HOST == $HOSTNAME ]]; then
     if [[ $(systemctl is-active btrbk.timer) != active ]]; then
-      chars+=("BTRBK-TIMER!")
+      chars+=("BTRBK.TIMER!")
+      lo -60 btrbk.timer "btrbk.timer not enabled"
     fi
 
     ## check if last snapshot was within an hour
@@ -61,6 +59,7 @@ write-status() {
     done
     if (( maxtime < now - 60*60 )); then
       chars+=("OLD-SNAPSHOT!")
+      lo -1 old-snapshot "/o snapshot older than 1 hour"
     fi
   fi