Sponsored Content
Top Forums Shell Programming and Scripting Need Emergency help with script! Post 302358143 by soupbone38 on Thursday 1st of October 2009 12:09:40 PM
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
Code:
./install.sfmelv[9]: syntax error at line 29 : `done' unexpected

Code:
#!/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


Last edited by vgersh99; 10-01-2009 at 01:11 PM.. Reason: code tags, PLEASE!
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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 2.how to create a process 3.how to kill a process 4.how to send information to a process 5.how to see a process 6.how to increase priority of a process 7.how to... (1 Reply)
Discussion started by: mortez28
1 Replies

6. 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

7. 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

8. 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
DH_INSTALLDEBCONF(1)						     Debhelper						      DH_INSTALLDEBCONF(1)

NAME
dh_installdebconf - install files used by debconf in package build directories SYNOPSIS
dh_installdebconf [debhelperoptions] [-n] [--params] DESCRIPTION
dh_installdebconf is a debhelper program that is responsible for installing files used by debconf into package build directories. It also automatically generates the postrm commands needed to interface with debconf. The commands are added to the maintainer scripts by dh_installdeb. See dh_installdeb(1) for an explanation of how that works. Note that if you use debconf, your package probably needs to depend on it (it will be added to ${misc:Depends} by this program). Note that for your config script to be called by dpkg, your postinst needs to source debconf's confmodule. dh_installdebconf does not install this statement into the postinst automatically as it is too hard to do it right. FILES
debian/package.config This is the debconf config script, and is installed into the DEBIAN directory in the package build directory. Inside the script, the token #DEBHELPER# is replaced with shell script snippets generated by other debhelper commands. debian/package.templates This is the debconf templates file, and is installed into the DEBIAN directory in the package build directory. debian/po/ If this directory is present, this program will automatically use po2debconf(1) to generate merged templates files that include the translations from there. For this to work, your package should build-depend on po-debconf. OPTIONS
-n, --no-scripts Do not modify postrm script. -- params Pass the params to po2debconf. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLDEBCONF(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy