X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=5f43270c3c9e516864451eb357515db853756764;hb=3ca4714d6b02ff279a0c724415f3e0a3a6f49059;hp=ff3b91fb84306bc7cee5ec924a20f37d34f8b314;hpb=110b15e4a7b19cc520d2aa3f2584f4213b94f5b7;p=distro-setup diff --git a/brc b/brc index ff3b91f..5f43270 100644 --- a/brc +++ b/brc @@ -879,7 +879,7 @@ ediff() { # mail related etail() { ngset - tail -F /var/log/exim4/mainlog /var/log/exim4/*main -n 200 "$@" + tail -F /var/log/exim4/mainlog /var/log/exim4/*main /var/log/exim4/paniclog /var/log/exim4/*panic -n 200 "$@" ngreset } etailm() { @@ -888,10 +888,11 @@ etailm() { etail2() { tail -F /var/log/exim4/mymain -n 200 "$@" } - ccomp tail etail etail2 + + # print exim old pids eoldpids() { local configtime pid piduptime now daemonpid @@ -2170,6 +2171,30 @@ nonet() { m() { printf "%s\n" "$*"; "$@"; } +# update file. note: duplicated in mail-setup +u() { + local tmp tmpdir dest="$1" + local base="${dest##*/}" + local dir="${dest%/*}" + if [[ $dir != "$base" ]]; then + # dest has a directory component + mkdir -p "$dir" + fi + ur=false # u result + tmpdir=$(mktemp -d) + cat >$tmpdir/"$base" + tmp=$(rsync -ic $tmpdir/"$base" "$dest") + if [[ $tmp ]]; then + printf "%s\n" "$tmp" + ur=true + if [[ $dest == /etc/systemd/system/* ]]; then + reload=true + fi + fi + rm -rf $tmpdir +} + + uptime() { if type -p uprecords &>/dev/null; then uprecords -B