Page 2 of 2

Re: Unzip ISO file

Posted: July 16th, 2012, 1:35 am
by exussum
Set the category processing

http://SAB_URL:PORT/config/categories/

You could use as default it wont do anything unless there is an iso

Re: Unzip ISO file

Posted: July 16th, 2012, 1:39 am
by mark1979smith
Perfect!

Thanks very much

Re: Unzip ISO file

Posted: July 16th, 2012, 1:44 am
by sander
mark1979smith wrote: Yes, everything is fine. It's working 100%.

My only bugbear is that I have select 'extract_iso.sh' from the scripts dropdown list for each download. Is there a way around this?
I think you can assign the script to the Default category. See http://wiki.sabnzbd.org/configure-categories . That way the script should be run always.

Re: Unzip ISO file

Posted: July 16th, 2012, 1:47 am
by mark1979smith
sander wrote:
mark1979smith wrote: Yes, everything is fine. It's working 100%.

My only bugbear is that I have select 'extract_iso.sh' from the scripts dropdown list for each download. Is there a way around this?
I think you can assign the script to the Default category. See http://wiki.sabnzbd.org/configure-categories . That way the script should be run always.
Thanks Sander,

I really appreciate your help in getting this sorted.

Mark

Re: Unzip ISO file

Posted: July 22nd, 2012, 8:56 am
by flipp3d
Hey Guys,

I've just taken my first steps in attempting to write a script that would extract items from an ISO archive after SABnzbd has downloaded it to my Synology, below is the code I'm using:

Code: Select all

#/bin/bash -x

IF EXISTS %1\*.iso goto ISO
goto END

:ISO
7z x *.iso
7z x *.ISO

:END
echo Done.
I've called this file 7z-iso-extract.sh and placed it in my scripts folder for SABnzbd, I then ran the following command through PuTTY:
chmod a+x \FILEPATH\7z-iso-extract.sh

and the command line didn't return any output, just looked like it completed the operation.
When I then run the command to test it I get a not found error (I CD'd to the directory where the script is stored first):
7z-iso-extract.sh /FILE_PATH_OF_ISO_FILE/downloaded_file.iso the following error appears "-ash: 7z-iso-extract.sh: not found"

I listed the files in that directory and the file is clearly there, I also tried listing the entire path and it would not work.

I attempted to tell SABnzbd to use the script as through the post-processing scripts but I get the following error:
Exit(-1) Cannot run script /FILE_PATH_TO_SCRIPTS/7z-iso-extract.sh

Can anyone offer any help as to how I can get this to work so that it will extract the ISO's after it downloads them?
My idea is to use DropFolders to monitor the completed downloads folder for VIDEO_TS folders (DropFolders won't look in subfolders) so it will automatically kickoff Handbrake once a download is complete and the ISO extracted.

Any and all help would be very appreciated!

Re: Unzip ISO file

Posted: July 22nd, 2012, 9:20 am
by shypike
The first line should be:
#!/bin/bash
Note the exclamation mark.

IF EXISTS
is not Bash language, but Windows command prompt.

Parameters are $1 and not %1 (the latter being Windows speak)

I think you should look for a Bash tutorial.

BTW:
I think your script should have this line too:
cd "$1"
This is to make the job folder the current directory.