DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2012-11-30 14:57:34

SamuelSG
New member
Registered: 2012-11-30
Posts: 1

Sending email to download the complete transmission

One of the things that I was upset when using the transmission was not received more e-mails when downloads finished, but the benefits of using it made ​​the difference, after a time thinking and researching joining some ideas could solve my problem and I put - it here already that the community has always helped me a lot here, come on.

First follow this tutorial http://bernaerts.dyndns.org/linux/207-dns325-sendmail

Simplifying a bit just run the following commands:

mkdir -p /ffp/etc/msmtp
touch /ffp/etc/msmtp/msmtp.conf
chmod 600 /ffp/etc/msmtp/msmtp.conf
vim /ffp/etc/msmtp/msmtp.conf

# script
# Set gmail default values
defaults
tls on
tls_certcheck off

# Gmail account parameters
account default
host smtp.gmail.com
port 587
from your.address@gmail.com
auth on
user your.address@gmail.com
password yourgmailpassword

# set log file
logfile /ffp/etc/msmtp/msmtp.log
# script

Now let's create the script shipping

vim /ffp/home/mail.sh

## script
#!/ffp/bin/sh

##########################################################################################
# Autor: Samuel Goncalves
#########################################################################################

echo " " > /ffp/tmp/mail.txt
echo "To:your.address@gmail.com" >> /ffp/tmp/mail.txt # For those who vai e-mail
echo "Subject:Download concluido com sucesso" >> /ffp/tmp/mail.txt # subject
ls -lt /mnt/HD/HD_a2/downloads/ | grep ^[-d] | cut -d : -f2 | cut -d " " -f2-5 | head -1 >> /ffp/tmp/mail.txt # Checks the last added file in the folder

chmod 775 -R /mnt/HD/HD_a2/downloads/ # Fixing permissions to be able to delete the files after
chown nobody.allaccount -R /mnt/HD/HD_a2/downloads/ # Fixing permissions to be able to delete the files after

cat /ffp/tmp/mail.txt | /usr/bin/msmtp --file=/ffp/etc/msmtp/msmtp.conf --read-recipients # Command to send the email

## script

Make the file executable

    chmod 775 /ffp/home/email.sh
    chown nobody.allaccount /ffp/home/email.sh
   
Now just let the transmission

...
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/mnt/HD/HD_a2/ffp/home/email.sh",
...


And

vim /ffp/start/transmission.sh

...

status_cmd="transmission_status"
user=root
#user=nobody
su_cmd="/ffp/bin/su"

...
Sorry google translator .. :-)

Last edited by SamuelSG (2012-12-03 17:56:20)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB