diff options
Diffstat (limited to 'aux/git-checkers/logrotchecker')
-rwxr-xr-x | aux/git-checkers/logrotchecker | 16 |
1 files changed, 16 insertions, 0 deletions
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 |