X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=9bc89d5158c499ff9892e08c26e1f193f5dcc690;hb=0249e646cbed14fc191827f95a05044287d419ad;hp=1e2f999d72d7728da9c185c1372386a715738f4d;hpb=12cab163424e3a7b0815646d1d4407f9b5839bcb;p=distro-setup diff --git a/brc2 b/brc2 index 1e2f999..9bc89d5 100644 --- a/brc2 +++ b/brc2 @@ -35,7 +35,6 @@ esac # generated instead of dynamic for the benefit of shellcheck #for x in /a/bin/distro-functions/src/* /a/bin/!(githtml)/*-function?(s); do echo source $x ; done source /a/bin/distro-functions/src/identify-distros -source /a/bin/distro-functions/src/package-manager-abstractions source /a/bin/log-quiet/logq-function # for x in /a/bin/bash_unpublished/source-!(.#*); do echo source $x; done source /a/bin/bash_unpublished/source-semi-priv @@ -283,6 +282,26 @@ aclear() { system-status _ } +alerts() { + find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f +} +ralerts() { # remote alerts + local ret shell + # this list is duplicated in check-remote-mailqs + for h in bk je li frodo kwwg x3wg x2wg kdwg sywg; do + echo $h: + shell="ssh $h" + if [[ $HOSTNAME == "${h%wg}" ]]; then + shell= + fi + ret=0 + $shell find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f || ret=$? + if (( ret )); then + echo ret:$ret + fi + done +} + ap() { # pushd in case current directory has an ansible.cfg file pushd /a/xans >/dev/null @@ -631,6 +650,9 @@ digme() { digdiff @ns{1,2}.iankelling.org "$@" } +tsr() { # ts run + "$@" |& ts || return $? +} dup() { local ran_d @@ -639,20 +661,20 @@ dup() { case $PS1 in *[\ \]]D\ *) pushd / - /b/ds/distro-begin || return $? - /b/ds/distro-end || return $? + /b/ds/distro-begin |& ts || return $? + /b/ds/distro-end |& ts || return $? popd ran_d=true ;;& *[\ \]]DB\ *) pushd / - /b/ds/distro-begin || return $? + /b/ds/distro-begin |& ts || return $? popd ran_d=true ;; *[\ \]]DE\ *) pushd / - /b/ds/distro-end || return $? + /b/ds/distro-end |& ts || return $? popd ran_d=true ;;& @@ -1019,11 +1041,11 @@ wghole() { local host ipsuf umask_orig host=$1 ipsuf=$2 - mkdir -p /p/c/machine_specific/$host/filesystem/etc/{wireguard,network/interfaces.d} + mkdir -p /p/c/machine_specific/$host/filesystem/etc/wireguard cd /p/c/machine_specific/$host/filesystem/etc/wireguard umask_orig=$(umask) umask 0077 - wg genkey | tee $host-priv.key | wg pubkey > $host-pub.key + wg genkey | tee hole-priv.key | wg pubkey > hole-pub.key cat >wghole.conf </dev/null; then + sudo umount /mnt/$base + fi l=$(sudo cryptsetup status /dev/mapper/$base|sed -rn 's/^\s*device:\s*(.*)/\1/p') sudo cryptsetup luksClose /dev/mapper/$base || return 1 sudo losetup -d $l @@ -1287,7 +1311,7 @@ pumpa() { # other tiling window managers in giving up on setting it at all # xprop -root -remove _NET_WORKAREA - command pumpa &r + command pumpa & r } # reviewboard, used at my old job @@ -1490,7 +1514,7 @@ tm() { (sleep $(calc "$* * 60") && mpv --no-config --volume 50 /a/bin/data/alarm.mp3) > /dev/null 2>&1 & } -trg() { transmission-remote-gtk&r; } +trg() { transmission-remote-gtk & r; } trc() { # example, set global upload limit to 100 kilobytes: # trc -u 100 @@ -1584,10 +1608,10 @@ vpncmd() { m sudo -E env "PATH=$PATH" nsenter -t $(pgrep -f "/usr/sbin/openvpn .* --config /etc/openvpn/.*client.conf") -n -m "$@" } vpnf() { - vpncmd sudo -E -u iank env "PATH=$PATH" abrowser -no-remote -P vpn &r + vpncmd sudo -E -u iank env "PATH=$PATH" abrowser -no-remote -P vpn & r } vpn2f() { - vpncmd sudo -u iank env "PATH=$PATH" abrowser -no-remote -P vpn2 &r + vpncmd sudo -u iank env "PATH=$PATH" abrowser -no-remote -P vpn2 & r } vpni() { @@ -1703,10 +1727,10 @@ vpnoff() { sudo systemctl stop $vpn_service@$1 } vpnoffc() { # vpn off client - ser stop openvpn-nn@client + ser stop openvpn-client-tr@client } vpnc() { - ser start openvpn-nn@client + ser start openvpn-client-tr@client }