Need Emergency help with script!

I'm trying to write a script to push out to all our servers some Veritas add-ons. I want the script to push to all servers and if there server hardware matches the uname -i statement, it will install a additional add-on.. The script keeps giving me a error on line 29. Here is the script.
Please Help! I need this script working soon.

install.sfmelv: installing Sun Management Center

./install.sfmelv[9]: syntax error at line 29 : `done' unexpected
#!/bin/ksh
PATH=/usr/bin:/usr/sbin:/opt/local/bin:/usr/local/bin:/tmp
PGM=`basename $0`
HOSTS=$1

[[ -z $HOSTS ]] && HOSTS="`grep -v \# /opt/local/etc/hosts|grep -i sunsrv114|nawk '{print $1}'`"

echo "$PGM: installing Sun Management Center"
  for host in $HOSTS
  do
      printf "o PROCESSING HOST: %-20s\n" $host
      ping $host 1>/dev/null 2>&1;     
      if (( $? )) ; then         
          echo "--Cannot contact host $host";         
      else         
          echo "  --installing Sun Management Center SOLARIS SPARC AGENT on $host"              
          scp agent-update.bin smcseed $host:/tmp
          ssh $host 'cd /tmp/ ; /tmp/agent-update.bin -s sunsmc01 -r 8080 -f smcseed -p smc4agtsparc'
  sleep 15
          echo "  --installing Sun Management Center HALYCON MODULE on $host"           
          ssh $host 'cd /tmp/ ; /tmp/agent-update.bin -s sunsmc01 -r 8080 -p Hal-modules'
          # Netra Servers       
          if [ `uname -i` = 'SUNW,SPARC-Enterprise-T5220,SUNW,Sun-Fire-V440,SUNW,Sun-Fire-V240' ];then  
          echo "--Sun Management Netra hardware running elpv5 will be needed on $host";
        else
        echo "  --installing Sun Management Center ELPV5 MODULE on $host"
        ssh $host 'cd /tmp/ ; /tmp/agent-update.bin -s sunsmc01 -r 8080 -p elpv5'
     fi; 
 done line 29

where are your closing 'fi'-s for the matching 'if'-s?

---------- Post updated at 12:13 PM ---------- Previous update was at 12:13 PM ----------

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

Ad hoc, I see 2 if but only 1 fi :confused:

First off, please use CODE-tags when you post code. Not doing so confuses not only the reader but also our automatic translation tool, which (for obvious reasons) is supposed not to translate code.

Second, there is a special forum for emergency help. In all the other parts of the board asking for emergency is considered very rude (if you have such a pressing need HIRE someone instead of asking us) and inappropriate.

I'm going to close this thread until you tell me how you intend to remedy this situation.

-closed-

bakunin