From 640e0eecc6f41b2d3012624ad7eef93e3be3a305 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sat, 19 Jan 2013 16:25:41 +0000 Subject: [PATCH] improved cron script to report any malfunction by email --- extra/shutils/regressiontest_cronjob.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extra/shutils/regressiontest_cronjob.sh b/extra/shutils/regressiontest_cronjob.sh index 9a20bd3d6..b569b4e8d 100755 --- a/extra/shutils/regressiontest_cronjob.sh +++ b/extra/shutils/regressiontest_cronjob.sh @@ -6,9 +6,18 @@ SQLMAP_HOME="/opt/sqlmap" REGRESSION_SCRIPT="${SQLMAP_HOME}/extra/shutils" +FROM="regressiontest@sqlmap.org" +TO="bernardo.damele@gmail.com, miroslav.stampar@gmail.com" +SUBJECT="Automated regression test failed on $(date)" + cd $SQLMAP_HOME git pull rm -f output 2>/dev/null cd $REGRESSION_SCRIPT -python regressiontest.py +python regressiontest.py 1>/tmp/regressiontest.log 2>&1 + +if [ $? -ne 0 ] +then + cat /tmp/regressiontest.log | mailx -s "${SUBJECT}" -aFrom:${FROM} ${TO} +fi