Created
December 21, 2015 01:02
-
-
Save sky-y/69282e06d28c3c4099ea to your computer and use it in GitHub Desktop.
Send a EPUB file to Kindle (it needs kindlegen, postfix and mutt)
This file contains hidden or 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 | |
file_epub=$1 | |
file_mobi=${file_epub%epub}mobi | |
my_email="[email protected]" | |
if [ $# -ne 1 ]; then | |
echo "Usage: epub2kindle foo.epub" 1>&2 | |
exit 1 | |
fi | |
case "$file_epub" in | |
*\.epub) | |
# do nothing | |
;; | |
*) | |
echo "Error: Use .epub file." | |
exit 1 | |
;; | |
esac | |
kindlegen $file_epub && mutt -s \"\" -a $file_mobi -- $my_email < /dev/null | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment