git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/aux/git-checkers/sudoerschecker
blob: 1d7e7ed25cc19c6c36cb1e9f050a1c74234fed9b (plain)
1
2
3
4
5
6
7
8
9
#!/bin/bash

GITROOT="$(git rev-parse --show-toplevel)"||exit 1
SUDOERSDINV=( $(find "$GITROOT" -name sudoers.d -type d) )
SUDOERSD=1
[ "${#SUDOERSDINV[@]}" -eq 0 ]&&echo "No directory called sudoers.d found."&&SUDOERSD=0

[ "$SUDOERSD" -eq 1 ]&&for i in "${SUDOERSDINV[@]}"/*;do /usr/sbin/visudo -cf "$i";done
find "$GITROOT" -name sudoers -type f -exec /usr/sbin/visudo -cf '{}' \;