Skip to content

Instantly share code, notes, and snippets.

@bulv1ne
Created June 12, 2013 12:19
Show Gist options
  • Save bulv1ne/5764771 to your computer and use it in GitHub Desktop.
Save bulv1ne/5764771 to your computer and use it in GitHub Desktop.
#!/bin/sh
CMD=$1
SUBJECT=$2
FROM_EMAIL="server@example.com"
EMAIL=`cat ~/.email_addr`
if [ -z "$SUBJECT" ]
then
SUBJECT="'$CMD' `date +\"%A %d/%m/%Y\"`"
fi
{
echo From: $FROM_EMAIL
echo To: $EMAIL
echo Subject: $SUBJECT
echo ''
$CMD
} | /usr/sbin/sendmail $EMAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment