Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 640e0ee

Browse files
committed
improved cron script to report any malfunction by email
1 parent a24eaff commit 640e0ee

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

extra/shutils/regressiontest_cronjob.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66
SQLMAP_HOME="/opt/sqlmap"
77
REGRESSION_SCRIPT="${SQLMAP_HOME}/extra/shutils"
88

9+
10+
11+
SUBJECT="Automated regression test failed on $(date)"
12+
913
cd $SQLMAP_HOME
1014
git pull
1115
rm -f output 2>/dev/null
1216

1317
cd $REGRESSION_SCRIPT
14-
python regressiontest.py
18+
python regressiontest.py 1>/tmp/regressiontest.log 2>&1
19+
20+
if [ $? -ne 0 ]
21+
then
22+
cat /tmp/regressiontest.log | mailx -s "${SUBJECT}" -aFrom:${FROM} ${TO}
23+
fi

0 commit comments

Comments
 (0)