I'm pretty sure I have an issue with my syntax. I've made a simple if/ifthen script, but it hasn't executed. I can't find anything online about it, because I don't know exactly what the issue is.
After fixing most of the problems I'm left with this output:
/media/satahd/media/test.sh: line 21: syntax error near unexpected token `fi'
/media/satahd/media/test.sh: line 21: `fi'
here's the script:
#!/bin/bash
###root symlink folder:
rootmedia='/media/satahd/media/slinktest'
###root donwload folder:
rootdownload='/media/satahd/media/downloads'
TR_TORRENT_NAME=$1
TR_TORRENT_DIR=$2
anime=$rootdownload'/anime'
movie=$rootdownload'/movies'
western=$rootdownload'/western'
if [ $TR_TORRENT_DIR == $anime ] then
filebot --action symlink --conflict skip --db AniDB --format "{n} ({y})/{n} {s00e00} {t}({group} {vf})" -r -rename $anime/$TR_TORRENT_NAME non-strict --output $rootmedia/Shows/Anime --order absolute
elseif [ $TR_TORRENT_DIR == $movie ] then
filebot --action symlink --conflict skip --db themoviedb --format "{n} ({y})/{n} ({y}) {group} {vc}-{vf} {ac}-{af}" -r -rename $movie/$TR_TORRENT_NAME -non-strict --output $rootmedia/Movies
elseif [ $TR_TORRENT_DIR == $western ] then
filebot --action symlink --conflict skip --db thetvdb --format "{n} ({y})/{n} {s00e00} {t}({group} {vf})" -r -rename $western/$TR_TORRENT_NAME non-strict --output $rootmedia/Shows/Western --order absolute
fi