Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created May 22, 2016 01:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwenzel/4ecc41c7f1a2e4c6262775c614050d74 to your computer and use it in GitHub Desktop.
Save pwenzel/4ecc41c7f1a2e4c6262775c614050d74 to your computer and use it in GitHub Desktop.
Send iOS push notification when torrent is complete, via Pushover
#!/bin/sh
#
# Send push notification to pushover device when a torrent is complete.
#
# Requires: Pushover account, Transmission torrent client and curl.
#
# Get the API token from the pushover website.
# Change text output below if you wish.
# Set Transmission to start script when torrent is complete.
# Make sure you keep this script as Plain-text, save changes.
# Open Terminal, go to folder of this script and do “chmod +x TransmissionPushover.sh”
#
#
# https://forum.transmissionbt.com/viewtopic.php?t=15918
# https://pushover.net/
# http://www.transmissionbt.com
#
#
# Available environment variables from Transmission (as of v2.83) are:
#
# TR_APP_VERSION
# TR_TIME_LOCALTIME
# TR_TORRENT_DIR
# TR_TORRENT_HASH
# TR_TORRENT_ID
# TR_TORRENT_NAME
#
# Insert your own tokens
TOKEN_USER="USER_TOKEN";
TOKEN_APP="APP_TOKEN";
# Message for the notification.
MESSAGE="$TR_TORRENT_NAME finished downloading.
$TR_TIME_LOCALTIME";
PRIORITY=0;
SOUND="tugboat";
TITLE="Download complete";
TIMESTAMP=$(date +%s);
curl -s --form-string "token=$TOKEN_APP" --form-string "user=$TOKEN_USER" --form-string "timestamp=$TIMESTAMP" --form-string "priority=$PRIORITY" --form-string "sound=$SOUND" --form-string "title=$TITLE" --form-string "message=$MESSAGE" https://api.pushover.net/1/messages.json
#
#
# EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment