Transmission - Run CURL script when torrent is done

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
zip
Posts: 4
Joined: Thu Aug 22, 2013 10:21 pm

Transmission - Run CURL script when torrent is done

Post by zip »

Hey there!

I'm having a little bit of calling my Curl Script. If I use sh script.sh it works. But not unless I do it my self.


This is settings.json

Code: Select all

   
"script-torrent-done-enabled": true, 
"script-torrent-done-filename": "~/var/script/script.sh", 


Please help!
zip
Posts: 4
Joined: Thu Aug 22, 2013 10:21 pm

Re: Transmission - Run CURL script when torrent is done

Post by zip »

I have tried chmod 777 script.sh and chmod +x script.sh (No return message)
zip
Posts: 4
Joined: Thu Aug 22, 2013 10:21 pm

Re: Transmission - Run CURL script when torrent is done

Post by zip »

My code:

Code: Select all

#!/bin/sh

curl -s \
-F "token=xxx" \
-F "user=xxx" \
-F "message=$TR_TORRENT_NAME: $TR_TIME_LOCATION" \
https://api.pushover.net/1/messages.json > dev/null
Found some of the lines online, I did some changes myself. It works when I do sh script.sh
zip
Posts: 4
Joined: Thu Aug 22, 2013 10:21 pm

Re: Transmission - Run CURL script when torrent is done

Post by zip »

#!/bin/sh

curl -s \
-F "token=xxx" \
-F "user=xxx" \
-F "message=$TR_TORRENT_NAME: $TR_TIME_LOCATION" \
https://api.pushover.net/1/messages.json > dev/null

It is for for Pushover( https://pushover.net/ ).

Code: Select all

curl -s \
  -F "token=APP_TOKEN" \
  -F "user=USER_KEY" \
  -F "message=hello world" \
  https://api.pushover.net/1/messages.json
What I want to do:

Transmission downloaded torrent.mp4
Run script
Get push notification on my Iphone using Pushover
Smudge
Posts: 3
Joined: Thu Mar 17, 2011 5:19 am

Re: Transmission - Run CURL script when torrent is done

Post by Smudge »

Expanding the ~ to the full path is a shell function which might not be available to the transmission daemon environment. Try replacing it with the full proper path.
Post Reply