all: ~/.local/distro-begin ~/.local/distro-end
~/.local/distro-begin: distro-begin
- distro-begin
+ distro-begin mail-setup
~/.local/distro-end: distro-end distro-pkgs pkgs
distro-end
source /usr/share/wcd/wcd-include.sh
fi
-if [[ -s ~/.iank/ll-function ]]; then
- # shellcheck source=.iank/ll-function
+if [[ -s /a/bin/small-misc-bash/ll-function ]]; then
+ # shellcheck source=/a/bin/small-misc-bash/ll-function
+ source /a/bin/small-misc-bash/ll-function
+elif [[ -s ~/.iank/ll-function ]]; then
source ~/.iank/ll-function
fi
eless() {
less /var/log/exim4/mainlog
}
+eqcat() {
+ exiqgrep -i | while read i; do
+ exim -Mvh $i; hr; exim -Mvb $i; hr;
+ exigrep $i /var/log/exim4/mainlog; hr
+ done
+}
# shellcheck disable=SC2032
}
lipush() {
rsync $@ --delete-excluded -ahviSAXPH --specials --devices --delete --relative \
- --exclude-from=/p/c/li-rsync-excludes /a/bin /a/exe /a/h /a/c /p/c/machine_specific/li /a/opt/{emacs,emacs-debianstable,mu} root@li:/
+ --exclude-from=/p/c/li-rsync-excludes /a/bin /a/exe /a/h /a/c /p/c/machine_specific/li /a/opt/{emacs,emacs-debianstable,mu} root@iankelling.org:/
+ rsync -ahviSAXPH root@iankelling.org:/a/h/proposed-comments/ /a/h/proposed-comments
}
-lipushnoe() {
+lipushnoe() { # noe = noemacs. for running faster.
rsync $@ --delete-excluded -ahviSAXPH --specials --devices --delete --relative \
--exclude-from=/p/c/li-rsync-excludes /a/bin /a/exe /a/h /a/c /p/c/machine_specific/li root@li:/
}
ran_d=false
case $PS1 in
*DISTRO-BEGIN*)
- /b/ds/distro-begin
+ /b/ds/distro-begin || return $?
ran_d=true
;;&
*DISTRO-END*)
- /b/ds/distro-end
+ /b/ds/distro-end || return $?
ran_d=true
;;&
*CONFLINK*)
fi
;;
esac
+ system-status _
}
envload() { # load environment from a previous: export > file
--- /dev/null
+#!/bin/bash
+# Copyright (C) 2019 Ian Kelling
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+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
+
+qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
+if [[ $qlen != 0 ]]; then
+ printf "%s" $qlen
+fi
+cd /var/mail
+find . -type f \! -empty -print -quit
shopt -s dotglob
-for h in tp.b8.nz vpn1 x2 x3.b8.nz frodo.b8.nz kd.b8.nz kw; do
+for h in tp.b8.nz vpn1 x2 x3.b8.nz frodo.b8.nz kd.b8.nz kw iankelling.org; do
if [[ $HOSTNAME == "${h%%.*}" ]]; then
continue
fi
- if c=$(timeout 1 ssh $h /usr/sbin/exiqgrep -o 60 -c -b 2>/dev/null | awk '{print $1}' ) && [[ $c && $c != 0 ]]; then
+ if c=$(timeout 1 ssh root@$h /b/ds/check-mailq 2>/dev/null ) && [[ $c ]]; then
echo q:$h=$c
fi
done
s() { sudo "$@"; }
lnf() { /a/exe/lnf "$@"; }
-if [[ $1 == -f ]]; then
+if [[ $1 == -f ]]; then # f for fast
lnf() { ln -sf "$@"; }
+elif
+ [[ $1 ]]; then
+ echo "error: unrecognized arguments" >&2
+ exit 0
fi
shopt -s nullglob
###### stop znc setup #####
-
+ echo 0 >~/.local/distro-end
echo "$0: $(date): ending now)"
exit 0
;;
EOF
echo | /a/exe/cedit mail /etc/dnsmasq-servers.conf || [[ $? == 1 ]]
- systemctl reload dnsmasq
+ if systemctl is-active dnsmasq >/dev/null; then
+ systemctl reload dnsmasq
+ fi
systemctl disable mailclean.timer &>/dev/null ||:
systemctl stop mailclean.timer &>/dev/null ||:
hostname -f > /etc/mailname
- # We set this to alerts on MAIL_HOST, but using a user that doesn't exist elsewhere
+ # This ends up at alerts mailbox on MAIL_HOST, but using a user that doesn't exist elsewhere
# is no good.
sed -i --follow-symlinks -f - /etc/aliases <<EOF
-\$a root:
+\$a root: root@mail.iankelling.org
/^root:/d
EOF
ruby-rest-client
traceroute
tree
+ uptimed
vim
wcd
wget
telnet
transmission-remote-gtk
trash-cli
- uptimed
vlc
w3m
whois
chars+=("q $qlen")
fi
+ cd /b/ds
if ! make -q ~/.local/distro-begin || [[ $(<~/.local/distro-begin) != 0 ]]; then
chars+=("DISTRO-BEGIN!")
fi
f=~/.local/conflink
if [[ -e $f ]]; then
- cd /b/ds
now=$(date +%s)
fsec=$(stat -c%Y $f)
fmin=$(( (fsec - now ) / 60 + 1 ))