Filebot exit code
Posted: 10 Oct 2014, 15:05
Hi there,
I am running this little script, invoked by Deluge upon download completion:
As you can see, after Filebot renames and moves the movie/tvshow file, I delete the leftover files. Problem is, sometimes Filebot does not recognize TORRENT_NAME, and so it does not move it and I end up deleting it.
I tried retrieving ?$ - Filebot's exit code - but it is always 0. How can I tell if Filebot succeeded in renaming or not?
Thanks!
I am running this little script, invoked by Deluge upon download completion:
Code: Select all
#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3
LOG_FILE="${HOME}/deluge-postprocess.log"
filebot -script fn:amc --output "$HOME/Videos" --log-file amc.log --action move --conflict override -non-strict --def artwork=n subtitles=en,he "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=#$TORRENT_NAME" &>> "${LOG_FILE}"
rm -frv "/$TORRENT_PATH/$TORRENT_NAME" &>> "${LOG_FILE}"
I tried retrieving ?$ - Filebot's exit code - but it is always 0. How can I tell if Filebot succeeded in renaming or not?
Thanks!