Code: Select all
#!/bin/bash -xu
# Input Parameters
TR_APP_VERSION="$TR_APP_VERSION"
TR_TIME_LOCALTIME="$TR_TIME_LOCALTIME"
TR_TORRENT_HASH="$TR_TORRENT_HASH"
TR_TORRENT_ID="$TR_TORRENT_ID"
ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
ARG_NAME="$TR_TORRENT_NAME"
ARG_LABEL="N/A"
# Configuration
CONFIG_OUTPUT="/mnt/antares/Media"
if [[ "$TR_TORRENT_DIR" =~ ^/mnt/usbhdd.* ]]
then
exit 0
fi
# ignore if already symlinked
LINKS=($(find $ARG_PATH -type l))
if [[ ${#LINKS[@]} -gt 0 ]]
then
exit 0
fi
transmission-remote -t ${TR_TORRENT_ID} -S
if [[ "$TR_TORRENT_DIR" =~ ^/mnt/bellatrix/downloads/tv_shows.* ]]
then
/usr/bin/filebot -script fn:amc --action keeplink --output "$CONFIG_OUTPUT" --conflict skip \
--filter '!readLines("/mnt/antares/scripts/tv_excludes.txt").contains(n)' \
-non-strict --log-file amc.log --def subtitles=en artwork=y excludeList=".excludes" \
ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" \
exec="chmod 664 {quote file} ; docker exec <container> curl -s -w '\n' 'http://localhost:8081/api/v1/<api_key>?cmd=show.refresh&tvdbid={info.id}'" \
--def @/mnt/antares/scripts/pushover.txt \
--def movieFormat=@/mnt/antares/scripts/movieFormat.groovy \
--def seriesFormat=@/mnt/antares/scripts/seriesFormat.groovy
else
/usr/bin/filebot -script fn:amc --action keeplink --output "$CONFIG_OUTPUT" --conflict skip \
--filter '!readLines("/mnt/antares/scripts/movie_excludes.txt").contains(n)' \
--log-file amc.log --def subtitles=en artwork=y excludeList=".excludes" \
ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" \
exec="chmod 664 {quote file}" \
--def @/mnt/antares/scripts/pushover.txt \
--def movieFormat=@/mnt/antares/scripts/movieFormat.groovy \
--def seriesFormat=@/mnt/antares/scripts/seriesFormat.groovy
fi
transmission-remote -t ${TR_TORRENT_ID} -s
Also I wanted to ask if it's possible to do something like the following for the exec script:
Code: Select all
# instead of
--def exec="chmod 664 {quote file} ; docker exec <container> curl -s -w '\n' 'http://localhost:8081/api/v1/<api_key>?cmd=show.refresh&tvdbid={info.id}'"
# using
--def exec="/mnt/antares/scripts/after_rename.sh {quote file} {info.id}"
Code: Select all
#!/bin/bash -xu
chmod 664 "${1}"
docker exec <container> curl -s -w "\n" "http://localhost:8081/api/v1/<api_key>?cmd=show.refresh&tvdbid=${2}"