feat: check repo script

This commit is contained in:
Strix 2023-10-22 17:45:03 +02:00
parent 1cd2b290de
commit a171a058f9
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
3 changed files with 34 additions and 0 deletions

14
tools/repo/check.d/crontabs.sh Executable file
View file

@ -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

View file

@ -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

12
tools/repo/check.sh Executable file
View file

@ -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