diff --git a/tools/repo/check.d/crontabs.sh b/tools/repo/check.d/crontabs.sh new file mode 100755 index 0000000..23fea1d --- /dev/null +++ b/tools/repo/check.d/crontabs.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e +for cronfile in skel/etc/cron.d/*; do + echo "checking $cronfile..." + if ! echo "$cronfile" | grep -q "."; then + echo "$cronfile: crontabs may not have an extension" + exit 1 + fi + if ! [ $(tail -c1 "$cronfile" | wc -l) -gt 0 ]; then + echo "$cronfile: crontabs must end with a newline" + exit 1 + fi +done \ No newline at end of file diff --git a/tools/repo/check.d/docker-compose-config.sh b/tools/repo/check.d/docker-compose-config.sh new file mode 100755 index 0000000..e1e0393 --- /dev/null +++ b/tools/repo/check.d/docker-compose-config.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +for s in servers/*; do + echo "checking $s..." + HOSTNAME=$(echo $s | sed 's/servers\///') bash tools/server-docker-compose.sh config -q +done \ No newline at end of file diff --git a/tools/repo/check.sh b/tools/repo/check.sh new file mode 100755 index 0000000..2e2deeb --- /dev/null +++ b/tools/repo/check.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e +for c in tools/repo/check.d/*; do + echo "running $c..." + $c | while read line; do + echo -e "$c: $line" + done +done + +echo "repo is OK" +exit 0 \ No newline at end of file