Skip to content

Commit 60865bd

Browse files
committed
add logging to grades.sh
1 parent 65090b4 commit 60865bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

grades-docker/grades.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ fi
88
/usr/bin/diff grades.txt /tmp/grades.txt > /tmp/diff.txt
99
if [ -s /tmp/diff.txt ]; then
1010
(echo -e "From: Grades <${USERNAME}>\nSubject: Grades changed\n\n"; cat /tmp/diff.txt; echo -e '\n\nAll grades:\n'; cat /tmp/grades.txt) | /usr/sbin/sendmail $NOTIFY_RECIPIENT
11+
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME grades.sh[$$]: Sent mail to ${NOTIFY_RECIPIENT}."
12+
else
13+
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME grades.sh[$$]: No changes detected."
1114
fi
1215
mv /tmp/grades.txt grades.tx

0 commit comments

Comments
 (0)