neb/tools/repo/check.d/crontabs.sh

14 lines
360 B
Bash
Raw Normal View History

2023-10-22 17:45:03 +02:00
#!/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