3 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5 [[ $EUID == 0 ]] ||
exec sudo
-E "${BASH_SOURCE[0]}" "$@"
8 # for first run, accept host key
10 opt
=(-e 'ssh -oStrictHostKeyChecking=no')
14 f
=/a
/bin
/bash_unpublished
/source-state
21 local_mx
=mail.iankelling.org
22 # ||: is to allow for temporary connection issues.
23 rsync
"${opt[@]}" -ogtL --chown=root
:Debian-exim
--chmod=640 \
24 root@li.iankelling.org
:/etc
/letsencrypt
/live
/mail.iankelling.org
/{fullchain.pem
,privkey.pem
} /etc
/exim4 ||
:
25 if ! openssl x509
-checkend $
(( 60 * 60 * 24 * 3 )) -noout -in /etc
/exim
4/fullchain.pem
; then
26 echo "$0: error!: cert rsync failed and it will expire in less than 3 days"
32 # note: exim spec, 5.3 command line option -bd says that all files except
33 # .include "are reread each time they are used."