From 0632591996893fe136a1f2fe44d9b9f404f41f3e Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Thu, 1 Nov 2018 13:30:58 +0100 Subject: Initial commit --- aux/git-checkers/logrotchecker | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 aux/git-checkers/logrotchecker (limited to 'aux/git-checkers/logrotchecker') diff --git a/aux/git-checkers/logrotchecker b/aux/git-checkers/logrotchecker new file mode 100755 index 0000000..4f16efe --- /dev/null +++ b/aux/git-checkers/logrotchecker @@ -0,0 +1,16 @@ +#!/bin/bash + +# No way to push this to gitlab's CI runner YAML for now, so here's the script: +RETVAL=0 + +LOGROTS="$(find . -name "logrotate*" -type d|wc -l)" +[ "$LOGROTS" -eq 0 ]&&echo "No directory with a name starting with logrotate found."&&exit 0 + +for i in $(find . -name "logrotate*" -type d)/*;do + ERRCNT="$(/usr/sbin/logrotate -ds /tmp/logrotcheck "$i" 2>&1|grep '^error:'|grep -vcE 'unknown group|found error')" + echo "$i: $ERRCNT errors" + [ "$ERRCNT" -ne 0 ]&&((++RETVAL)) + continue +done + +exit $RETVAL -- cgit v1.2.3