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
dtsdate(1m)															       dtsdate(1m)

NAME
dtsdate - Sets local clock from a remote dtsd server host SYNOPSIS
dtsdate [-q] [-s] [-u] remote_host [nsecs] ARGUMENTS
Queries the difference in time between the local host and the remote host, but does not change the local clock. The returned result (2 if the time would have been reset, 1 if there was an error, and 0 otherwise) can be used by a script to determine what action to take. Causes dtsdate to work silently, without showing the time. Shows the time in UTC, rather than in the current time zone. The name or the IP address of a remote host that has a dtsd server. An integer giving the number of seconds by which the remote and local host times can dif- fer, without the local host's clock being reset. If nsecs is 0, or if it is not specified, it is treated as if it were extremely large, and no resetting occurs. DESCRIPTION
The dtsdate command sets the local clock of a system to be the same as the host remote_host, running a dtsd server. The purpose of dtsdate is to ensure that clock skew is minimized at initial cell configuration or at host instantiation, because it is difficult to start DCE and its components if the skew is too great. Clocks among all DCE components must be within five minutes of each other, to prevent failure of CDS and of security. Some DCE components have even more stringent requirements. For instance, a DFS file server cannot start if its local host differs from other DFS hosts by more than ten seconds. The dtsdate command can be used for adjusting a clock backwards, before DCE is running on a host. Adjusting a clock backwards while DCE is running can cause many difficulties, because security and file system software generally require system time to increase monotonically. NOTES
The remote host must be running as a DTS server. This means that the dtsd on that system must have registered the DTS management inter- face, because dtsdate uses the management call to get the current time from that host. For dtsdate to be able to set the clock, it must run as a privileged user (root). EXIT VALUE
If the -q argument is given, dtsdate returns 2 if the remote time and local time differ by more than nsecs, 1 if there was an error, and 0 otherwise. If the -q argument is not given, dtsdate returns 1 if there was an error, and 0 otherwise. EXAMPLES
With only the host argument: dtsdate remotehost dtsdate prints out the time on the remote host. In this example: dtsdate -s -q remotehost 10 dtsdate does not print out the remote host's time. If the times differ by more than 10 seconds, it returns the value of 1, otherwise 0. In the next example: dtsdate -s remotehost 10 dtsdate sets the clock if it differed from the remote clock by more than 10 seconds. It does this work silently, because of the -s option. The following example shows a shell script that uses the return value of dtsdate: dtsdate -s -q remhost 10 result = $? if [ $result -eq 0 ] ; then echo "Time is within tolerence." elif [ $result -eq 1 ] ; then echo "Could not contact remote host." >&2 else # result = 2 if dtsdate remhost 10; then # it failed! echo "Could not set the clock." >&2 fi fi RELATED INFORMATION
Commands: dtsd(1m) dtsdate(1m)
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy