git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/aux/git-checkers/logrotchecker
diff options
context:
space:
mode:
authorH. P. <harald.p.@xmart.de> 2018-11-01 13:30:58 +0100
committerH. P. <harald.p.@xmart.de> 2018-11-01 13:30:58 +0100
commit0632591996893fe136a1f2fe44d9b9f404f41f3e (patch)
tree7340edbe7c212da3db45a83219147143a3268c8d /aux/git-checkers/logrotchecker
downloadfedora-laptop-0632591996893fe136a1f2fe44d9b9f404f41f3e.tar.bz2
Initial commit
Diffstat (limited to 'aux/git-checkers/logrotchecker')
-rwxr-xr-xaux/git-checkers/logrotchecker16
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