Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
windyboi
Posts: 12 Joined: Tue Nov 10, 2015 7:26 pm
Post
by windyboi » Fri Feb 19, 2016 9:07 pm
Hello
I have written my first ever bash script and would really appreciate some help if this will work before I deploy it and break anything!!
I will be running this script on my FreeNAS jail:
Code: Select all
#! /bin/bash
# IF torrent contains music (torrent folder is in /mnt/music) then copy it to the afp share /mnt/newmusic
parentdir="$(dirname "$TR_TORRENT_DIR")"
if [ $parentdir="/mnt/music/" ]
then
cp $TR_TORRENT_DIR /mnt/newmusic
fi
Thank you so much
Last edited by
windyboi on Sun Feb 21, 2016 1:57 pm, edited 2 times in total.
windyboi
Posts: 12 Joined: Tue Nov 10, 2015 7:26 pm
Post
by windyboi » Sun Feb 21, 2016 1:56 pm
Doesn't seem to work :/ I've set the script for permissions 777 and tested it out but it's not happening. Argh!
windyboi
Posts: 12 Joined: Tue Nov 10, 2015 7:26 pm
Post
by windyboi » Thu Mar 03, 2016 8:27 am
Right I think I have bigger problems than formatting of the script..
In the FreeNAS GUI for transmission settings, under "Script torrent done" I've got /scripts/test.sh
test.sh is executable by all and contains:
#!/usr/local/bin/sh
echo "test" >> /scripts/test.txt
But, upon completion of a torrent, the script does NOT have the desired effect.
Do you know what might be causing this?
/scripts is also writeable by all (777 permission)
both the test.sh file and the directory are owned by the transmission user
windyboi
Posts: 12 Joined: Tue Nov 10, 2015 7:26 pm
Post
by windyboi » Thu Mar 03, 2016 7:25 pm
I can't find any settings.json using the guidance you provided. I am using FreeNAS built in transmission plugin, which has its own GUI options and thats is where I put the path to the script.
And yes, the test.txt isn't even created.
Thanks
windyboi
Posts: 12 Joined: Tue Nov 10, 2015 7:26 pm
Post
by windyboi » Thu Mar 03, 2016 8:43 pm
OMG the problem was the shebang at the top.. for whatever reason I was using /usr/local in my test and i changed t to just /bin/sh and now it works.
Sorry for hassle.. thanks for your assistance