Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- [ $# -ne 1 ] && exec echo "Usage: $0 <address>"
- boundary=$(hexdump -n16 -e '1 "%02x"' /dev/urandom)
- date=$(date '+%d-%m-%Y %R')
- {
- cat <<EOF
- From: Scan
- To: $1
- Subject: Scansione $date
- MIME-Version: 1.0
- Content-Type: Multipart/Mixed; boundary="$boundary"
- --$boundary
- Content-Disposition: inline
- Content-Transfer-Encoding: 7bit
- Allegato
- --$boundary
- Content-Type: image/jpeg
- Content-Transfer-Encoding: base64
- Content-Disposition: attachment; filename="scan-$date.jpg"
- EOF
- scanimage --mode Color --format jpeg |base64
- echo "--$boundary--"
- } |sendmail "$1" 2>/dev/null >/dev/null &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement