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!