periodic: Fix periodic reports when log files are not compressed.

The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.

PR:		253168
Reviewed by:	delphij
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43357
This commit is contained in:
Yoshihiro Takahashi 2024-01-10 20:48:56 +09:00
parent f552d7adeb
commit 1fa4ddcc6d
2 changed files with 2 additions and 12 deletions

View File

@ -49,12 +49,7 @@ catmsgs() {
sort -t. -r -n -k 2,2 |
while read f
do
case $f in
*.gz) zcat -f $f;;
*.bz2) bzcat -f $f;;
*.xz) xzcat -f $f;;
*.zst) zstdcat -f $f;;
esac
zcat -f $f
done
[ -f ${LOG}/auth.log ] && cat $LOG/auth.log
}

View File

@ -49,12 +49,7 @@ catmsgs() {
sort -t. -r -n -k 2,2 |
while read f
do
case $f in
*.gz) zcat -f $f;;
*.bz2) bzcat -f $f;;
*.xz) xzcat -f $f;;
*.zst) zstdcat -f $f;;
esac
zcat -f $f
done
[ -f ${LOG}/messages ] && cat $LOG/messages
}