title: .sh unexpected "fi (expected "then")
body: <p>I have some trouble getting my .sh script working. I get the following error message: </p>
  
  <pre><code>power_toggle.sh: line 8: syntax error: unexpected "fi" (expecting "then")
  </code></pre>
  
  <p>The script:</p>
  
  <pre><code>#!/bin/sh
  SERVICE='hyperiond'
  if pgrep $SERVICE &gt; /dev/null
  then
      killall hyperiond 2&gt;/dev/null
  else
      /storage/.config/autostart.sh &gt; /dev/null 2&gt;&amp;1 &amp;
  fi
  </code></pre>
  
  <p>I have tried shellcheck.net, and it doesn't find anything wrong with it.. 
  I have also chmod +x'ed it. The 2 commands work fine running them via a ssh terminal.</p>
  
  <p>Hope u guys can help, because I am lost.</p>