Last active
August 29, 2015 14:18
-
-
Save jdb8/f03bd8ef2b474c6d111a to your computer and use it in GitHub Desktop.
A simple hacky script to send an email via sendmail. This can be used as the supplied command for znc-push.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
EMAIL="you@example.com" | |
NEAT_DATE=`date +%Y-%m-%d` | |
FULL_DATE=`date +%Y-%m-%d:%H:%M:%S` | |
SUBJECT="New IRC Notification: $NEAT_DATE" | |
SENDER="ZNC-Push" | |
FOOTER="Received on $FULL_DATE" | |
MESSAGE=$(echo "$1" | tr -d '\011\012\015') # Remove tabs, carriage returns and newlines | |
echo "Emailing $EMAIL..." | |
echo "Message: $MESSAGE" | |
echo "Subject:$SUBJECT\n\n$MESSAGE\n\n$FOOTER" | sendmail -F "$SENDER" "$EMAIL" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment