Need Emergency help with script!

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need Emergency help with script!
# 1  
Old 10-01-2009
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

PGM=`basename $0`

[[ -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
      printf "o PROCESSING HOST: %-20s\n" $host
      ping $host 1>/dev/null 2>&1;     
      if (( $? )) ; then         
          echo "--Cannot contact host $host";         
          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";
        echo "  --installing Sun Management Center ELPV5 MODULE on $host"
        ssh $host 'cd /tmp/ ; /tmp/agent-update.bin -s sunsmc01 -r 8080 -p elpv5'
 done line 29

Last edited by vgersh99; 10-01-2009 at 02:11 PM.. Reason: code tags, PLEASE!
# 2  
Old 10-01-2009
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 [code] and [/code] 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
# 3  
Old 10-01-2009
Ad hoc, I see 2 if but only 1 fi Smilie
# 4  
Old 10-01-2009
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.


Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX emergency

can anyone please tell me that how can i boot unix from a cd? full procedure. it's an emergency. reply asap (1 Reply)
Discussion started by: niket agarwal
1 Replies

2. Solaris

Emergency !!!Help Please--- NFS

Hi Guru's, I am unable to mount NFS share on unix system (DG/UX) which is nfs client. Error: mount: /nfsshare: Invalid argument mount: giving up on: /mountpoint i tried following commands mount -t nfs remotehost:/nfsshare /mountpoint Error: mount: /nfsshare: Invalid... (1 Reply)
Discussion started by: Justin John
1 Replies

3. Shell Programming and Scripting

Emergency...!!! Shell Scripting.... How to start a same script in 3 different logins?

Hi, I've a shell script. If I trigger the script it takes one day to complete the execution. I've to start the same script in 3 different logins of Unix machine simultaneously. Do you have any idea how can I make it? Please suggest.:( Thank you.. (1 Reply)
Discussion started by: testin
1 Replies

4. Ubuntu

Emergency help with ubuntu

Hi guys i have some question about ubuntu(10.10) 1.what time scheduling & page replacement algorithm have been used in ubuntu to create a process to kill a process to send information to a process to see a process to increase priority of a process to... (1 Reply)
Discussion started by: mortez28
1 Replies

5. UNIX for Advanced & Expert Users

emergency shutdown best practices.

Has anyone implemented or have suggestions on how to shutdown many remote unix/linux servers from a single script initiated from 1 server? I need this to execute in parallel as time is not on my side. Our ups is sadly underrated and will die in approximately 15 minutes. (There is not... (10 Replies)
Discussion started by: jsw371
10 Replies

6. UNIX for Advanced & Expert Users

X development libraries!!! EMERGENCY!!!

checking for X... no configure: error: X development libraries not found I'm on a mac, trying to install GTK+. got the error above. could someone please let me know for x development libraries, what do i really need specifically???? this is sorta emergency because if i don't sort this out... (7 Replies)
Discussion started by: jingt86
7 Replies

7. UNIX for Dummies Questions & Answers

Emergency Recovery Problems

Any help here whatsoever will be greatly appreciated! Running ScoUnix on IBMx235 server. LTO1 tape drive. Need to set up DR box. Disks installed/configured by IBM techie. On production server: Ran emergency_disk -d /tmp diskette1 and diskette2 successfully. Rean emergency_rec -e ctape1... (0 Replies)
Discussion started by: kwagga123
0 Replies

8. SCO

Emergency boot

I need to boot an OpenServer 5.0.5 server but I don't have emergency boot disks for it. There are some boot disks of other servers. Can I use these disks, changing defbootstr ?. How ?. The fact is that administrator can't login as root and it seems to be a corrupted auth system issue. Other... (2 Replies)
Discussion started by: dags
2 Replies
Login or Register to Ask a Question