Need help with unrar script

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
AeroZ
Posts: 3
Joined: Fri Sep 08, 2017 7:11 am

Need help with unrar script

Post by AeroZ »

Hi!

I tried to do a script to unrar files when download completes but I'm unable to get it to work with Transmission's environment variables. I'm probably doing something wrong because running the command without using $TR_TORRENT_NAME works fine. Can you please point out what's wrong with the script?

Code: Select all

#!/bin/sh
find /Users/mike/Downloads/$TR_TORRENT_NAME/ -name "*.rar" -execdir unrar e -r -o- "{}" /Users/mike/Movies \;
Edited the script to not use variables and tested it with one specific torrent - didn't work. Dragged the .sh file to the Terminal and it worked. So Transmission is just not executing the script eventhough I've selected it to be run upon torrent completion.

Out of ideas. Anybody got some insight?
PS. Running on a Mac

Thanks!
AeroZ
Posts: 3
Joined: Fri Sep 08, 2017 7:11 am

Re: Need help with unrar script

Post by AeroZ »

Fixed it myself. If anybody is interested:

Code: Select all

#!/bin/sh
find "$TR_TORRENT_DIR"/"$TR_TORRENT_NAME" -name "*.rar" -execdir /usr/local/bin/unrar e -r -o- "{}" /path/to/extract/to \;
change "/path/to/extract/to" as you want.
Post Reply