+
+ bbkmsg=
+ if [[ $(systemctl is-active btrbk.timer) != active ]]; then
+ chars+=(BTRBK.TIMER)
+ bbkmsg="not enabled"
+ fi
+ p "$bbkmsg" | lo -480 btrbk.timer
+
+ ## check if last snapshot was within an hour
+ vol=o
+ # this section generally copied from btrbk scripts, but
+ # this part modified to speed things up by about half a second.
+ # I'm not sure if its quite as reliable, but it looks pretty safe.
+ # Profiled it using time and also adding to the top of the file:
+ # set -x
+ # PS4='+ $(date "+%2N") '
+ # allow failure in case there are no snapshots yet.
+ # shellcheck disable=SC2012
+ shopt -u nullglob
+ files=(/mnt/root/btrbk/$vol.20*)
+ shopt -s nullglob
+ snaps=()
+ if (( ${#files[@]} )); then
+ snaps=($(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : ))
+ fi
+ now=$EPOCHSECONDS
+ maxtime=0
+ for s in ${snaps[@]}; do
+ file=${s##*/}
+ t=$(date -d $(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${file#$vol.}) +%s)
+ if (( t > maxtime )); then
+ maxtime=$t
+ fi
+ done
+ snapshotmsg=
+ if (( maxtime < now - 4*60*60 )); then
+ chars+=(OLD-SNAP)
+ snapshotmsg="/o snapshot older than 4 hours"
+ fi
+ p "$snapshotmsg" | lo -1 old-snapshot
+
+
+ # commented out, only using timetrap retrospectively.
+ # # clock us out in timetrap if are idle too long
+ # if [[ -e /p/.timetrap.db ]]; then
+ # export DISPLAY=:0
+ # if type -p xprintidle &>/dev/null && xidle=$(xprintidle 2>/dev/null); then
+ # if [[ $xidle == [0-9]* ]]; then
+ # sheet=$(sqlite3 /p/.timetrap.db "select sheet from entries where end is NULL;")
+ # idle=300000
+ # if [[ $sheet == w ]]; then
+ # idle=900000
+ # fi
+ # if [[ $sheet && $xidle -gt $idle ]]; then
+ # timetrap out
+ # fi
+ # fi
+ # fi
+ # fi
+ else # end if $MAIL_HOST
+ rmg /home/iank/cron-errors/bounce* \
+ /home/iank/cron-errors/btrbk.timer* \
+ /home/iank/cron-errors/old-snapshot*
+ fi
+
+ if ip l show tunfsf &>/dev/null; then
+ # this is for tracking dns over tls issue, which
+ # fixvpndns() in brc2 fixes.
+ stat=$(resolvectl dnsovertls tunfsf 2>/dev/null ||: )
+ read _ _ _ istls <<<"$stat"
+ case $istls in
+ no) : ;;
+ *)
+ printf "%s\n" "$istls" | ts >> /tmp/istls.log
+ chars+=("T:$istls")
+ ;;
+ esac