Created
August 31, 2016 17:20
-
-
Save vekvoid/54cc932d4c9ce2ea611827d59ac208ea to your computer and use it in GitHub Desktop.
Send a email with a image marked as favorite on Variety.
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/bash | |
inotifywait -m ~/.config/variety/Favorites --exclude \.json -e create -e moved_to | | |
while read path action file; do | |
echo "The file '$file' appeared in directory '$path' via '$action'" | |
# do something with the file | |
SERVER_PORT="smtp.sendgrid.net:587" | |
SENDER="from@example.com" | |
RESEIVER="to@example.com" | |
USER="apikey" | |
PASSWORD="sendgridApiKey" | |
swaks --to $RESEIVER --from $SENDER --server $SERVER_PORT --auth LOGIN --auth-user $USER --auth-password $PASSWORD -S -tls --header "Subject: New image" --body "New image bookmarked." --attach "$path$file" | |
echo "$path$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment