title: Syntax error: "}" unexpected (expecting "fi")
body: <p>Here's a simple shell script downloaded from Atlassian and slightly adjusted to meet all suggestions found so far:</p>
  
  <pre><code>#!/bin/sh
  
  # RUN_AS: The user to run fisheye as. Its recommended that you create a separate user account for security reasons
  RUN_AS=fisheye
  
  # FISHEYE_HOME: The path to the FishEye installation. Its recommended to create a symbolic link to the latest version so
  # the process will still work after upgrades.
  FISHEYE_HOME="/opt/atlassian/fisheye"
  
  fisheyectl() {
          ARGS="--Xdisable-tags --Xenable-git-content-hash-resolving-heuristic"
          CMD="$FISHEYE_HOME/bin/fisheyectl.sh $1"
          if [ $1 == "run" ]
          then
              CMD="nohup $CMD $ARGS &gt;&gt; $FISHEYE_HOME/var/log/nohup.out &amp;";
          fi
          if [ "$USER" != "$RUN_AS" ]
          then
                  su - "$RUN_AS" -c "$CMD";
          else
                  sh -c "$CMD";
          fi
  }
  
  case "$1" in
          start)
                  fisheyectl run
                  ;;
          stop)
                  fisheyectl stop
                  ;;
          restart)
                  fisheyectl stop
                  sleep 10
                  fisheyectl run
                  ;;
          *)
                  echo "Usage: $0 {start|stop|restart}"
  esac
  
  exit 0
  </code></pre>
  
  <p>I have run this through dos2unix locally. On executing:</p>
  
  <pre><code>fisheye: 23: fisheye: Syntax error: "}" unexpected (expecting "fi")
  </code></pre>
  
  <p>Any suggestions?</p>