diff options
Diffstat (limited to 'aux/git-checkers/systemdchecker')
-rwxr-xr-x | aux/git-checkers/systemdchecker | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/aux/git-checkers/systemdchecker b/aux/git-checkers/systemdchecker new file mode 100755 index 0000000..85cb24e --- /dev/null +++ b/aux/git-checkers/systemdchecker @@ -0,0 +1,17 @@ +#!/bin/bash + +GITROOT="$(git rev-parse --show-toplevel)"||exit 1 + +echo -n "Locating systemd units..." +SVCFILES=( $(find "$GITROOT" -name "*.service" -exec grep -l '\[Unit\]' '{}' \;) ) +TGTFILES=( $(find "$GITROOT" -name "*.target" -exec grep -l '\[Unit\]' '{}' \;) ) +TMRFILES=( $(find "$GITROOT" -name "*.timer" -exec grep -l '\[Unit\]' '{}' \;) ) +MNTFILES=( $(find "$GITROOT" -name "*.mount" -exec grep -l '\[Unit\]' '{}' \;) ) +SYSTEMDFILES=( ${SVCFILES[@]} ${TGTFILES[@]} ${TMRFILES[@]} ${MNTFILES[@]} ) +echo " found ${#SYSTEMDFILES[@]} unit$([ "${#SYSTEMDFILES[@]}" -gt 1 ]&&echo -n "s") to check." + +export LOOPRV=0 +for i in "${SYSTEMDFILES[@]}";do + systemd-analyze verify "$i"&&echo "$i: $(tput -Txterm smul)OK$(tput -Txterm rmul)"||((++LOOPRV)) +done +exit $LOOPRV |