limit notify on last 100 lines

This commit is contained in:
olli 2022-12-01 10:22:15 +01:00
parent 161e01c399
commit 9c7bb2c86d

View File

@ -13,7 +13,7 @@ function g_echo_error {
cat <<< "$(date "+%F %T") $(hostname) $0($$) ERROR: $@ " | debian-chroot.sh /usr/local/bin/notify.sh cat <<< "$(date "+%F %T") $(hostname) $0($$) ERROR: $@ " | debian-chroot.sh /usr/local/bin/notify.sh
elif [ -x /usr/local/bin/notify.sh ] elif [ -x /usr/local/bin/notify.sh ]
then then
cat <<< "$(date "+%F %T") $(hostname) $0($$) ERROR: $@" | /usr/local/bin/notify.sh cat <<< "$(date "+%F %T") $(hostname) $0($$) ERROR: $@" | tail -n 100 | /usr/local/bin/notify.sh
fi fi
fi fi
[ -z $DISPLAY ] || zenity --error --ellipsize --text="$@" [ -z $DISPLAY ] || zenity --error --ellipsize --text="$@"