#!/bin/bash
# This is meant to be fire-and-forget
# Only use it if you trust the output!
-export DIR=`dirname $0`
+export DIR=$(readlink -f $(dirname $0))
+if [ -z "${MAKEOPTS}" ]; then
+ echo "MAKEOPTS env variable is not set"
+ echo "If you really want this to be serialized, export MAKEOPTS=-j1"
+ echo "Otherwise set it about 1.5x your number of CPUs!"
+ exit 1
+fi
[ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ)
[ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d outlook_export.XXXXXXX)
cd $OUTDIR
EOF
lftp -f lftp.cmd
chmod +x email-template.sh
-./email-tempate.sh "$T" "@$(date +%s)"
+./email-template.sh "$T" "@$(date +%s)" >email.txt
+/usr/lib/sendmail <email.txt