title: Getting "syntax error near unexpected token `fi'" in my bash script
body: <p>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.</p>
  
  <p>After fixing most of the problems I'm left with this output:</p>
  
  <pre><code>/media/satahd/media/test.sh: line 21: syntax error near unexpected token `fi'
  /media/satahd/media/test.sh: line 21: `fi'
  </code></pre>
  
  <p>here's the script:</p>
  
  <pre><code>#!/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
  </code></pre>