acfst/email_recipients.sh

20 lines
771 B
Bash
Raw Permalink Normal View History

#!/bin/bash
[[ -z "${@}" ]] && >&2 echo "Must supply email address list!" && exit 1
date=$(date -d '-1 day' +%F)
while [[ ! -z "${@}" ]]; do
addr=${1}
shift
mail -r acf.shiptracker@gmail.com \
-s "ACF ShipTracker Log" \
-a /var/log/acfst/ACFshipdata_${date}.csv \
${addr} << EOF
This is an automated ACF ShipTracker email. Attached is the log from yesterday (${date}). It contains all of the vessels coming through Mobile Bay that meet the thresholds (currently traveling over 10.0 knots and at least 15.0 meters wide). The format of the file is Comma Separated Values (CSV).
Please do not respond to this email. For assistance, please contact Justin Blancher (jeblancher@gmail.com) for any troubleshooting.
EOF
done