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
SSS_SSH_KNOWNHOSTSPR(1) 					 SSSD Manual pages					   SSS_SSH_KNOWNHOSTSPR(1)

NAME
sss_ssh_knownhostsproxy - get OpenSSH host keys SYNOPSIS
sss_ssh_knownhostsproxy [options] HOST [PROXY_COMMAND] DESCRIPTION
sss_ssh_knownhostsproxy acquires SSH host public keys for host HOST, stores them in a custom OpenSSH known_hosts file (see the "SSH_KNOWN_HOSTS FILE FORMAT" section of sshd(8) for more information) /var/lib/sss/pubconf/known_hosts and estabilishes connection to the host. If PROXY_COMMAND is specified, it is used to create the connection to the host instead of opening a socket. ssh(1) can be configured to use sss_ssh_knownhostsproxy for host key authentication by using the following directives for ssh(1) configuration: ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h GlobalKnownHostsFile2 /var/lib/sss/pubconf/known_hosts This is an experimental feature, please use http://fedorahosted.org/sssd to report any issues. OPTIONS
-p,--port PORT Use port PORT to connect to the host. By default, port 22 is used. -d,--domain DOMAIN Search for host public keys in SSSD domain DOMAIN. -h,--help Display help message and exit. SEE ALSO
ssh(8), ssh_config(5), sss_ssh_authorizedkeys(1). AUTHORS
The SSSD upstream - http://fedorahosted.org/sssd SSSD
03/04/2013 SSS_SSH_KNOWNHOSTSPR(1)
All times are GMT -4. The time now is 10:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy