Document that -j/--jpg is an option
[einar-bin] / generatortest.sh
1 #!/bin/bash
2 # generatortest notifier for icinga
3 # Alert if the file /tmp/generatortest is present, first with warning on Monday and then with critical on Thursday (day of test)
4 # Must have this cron job:
5 # At 08:00 on the first seven days of every month, check if it's a Monday, and output the date for the following thursday to the file /tmp/generatortest. Note that the % needs to be escaped when it's run through cron
6 # 0 8 1-7 * * root [ "$(LC_TIME=en_US date '+\%a')" = "Mon" ] && date --date='+3 days' '+\%Y\%m\%d\%H\%M' > /tmp/generatortest
7 TestFile="/tmp/generatortest"
8 if [ -e "${TestFile}" ]; then
9 TestDate="$(head -n 1 "${TestFile}")"
10 Today="$(date +%Y%m%d%H%M)"
11 if [ "${Today}" -lt "${TestDate}" ]; then
12 echo "Reminder: generator test on Thursday"
13 exit 1
14 else
15 echo "Please run generator test today, then delete ${TestFile}"
16 exit 2
17 fi
18 fi