LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2012, 12:19 AM   #1
piyush128k
Member
 
Registered: Jun 2012
Posts: 68
Blog Entries: 1

Rep: Reputation: Disabled
Need script to install .rpm packages with su login thru ssh on 20 suse computers


#!/bin/bash

sshsudo -D-c-r-v BATMAN-1.sun.com
BATMAN-2
BATMAN-3
BATMAN-4
BATMAN-5
BATMAN-6
BATMAN-7
BATMAN-8
BATMAN-9
BATMAN-10

rpm -Uvh --force --nodeps /apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm

exit
 
Old 08-17-2012, 12:53 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Is this a question or a statement? You need a script and have presented one. What else is there to do?
 
Old 08-17-2012, 01:03 AM   #3
piyush128k
Member
 
Registered: Jun 2012
Posts: 68

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
It does not run...i need to understand whats the mistake am making. I know it is small and probably silly cause......
 
Old 08-17-2012, 01:05 AM   #4
piyush128k
Member
 
Registered: Jun 2012
Posts: 68

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
i know my ssh command is right and my rpm command is right. the other thing is that i am to use a loop but i did not see the need. Hope I made my self clear on the two parts: mistake in script and is loop required?
 
Old 08-17-2012, 01:30 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Are you receiving an error?

I have not used sshsudo previously, but having a quick search on the net it seems to imply the server names should be comma separated.
Also, I would place your path (passed to rpm) in quotes other wise the * will be expanded and may not give you what you want. Examples also show the command as coming straight after
the server names and not on its own line.

So not sure if any of your switches change the default behaviour, but this would seem to be some things to look at.
 
Old 08-17-2012, 02:06 AM   #6
piyush128k
Member
 
Registered: Jun 2012
Posts: 68

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
#!/bin/bash

sshsudo -D-c-r-v
BATMAN-1.sun.com rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-2 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-3 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-4 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-5 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-6 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-7 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-8 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-9 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
BATMAN-10 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"

exit


Do you mean like this. And...hence I do not require to loop it right?
 
Old 08-17-2012, 03:20 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Does that work?

But no, my thinking was more along the lines:
Code:
#!/bin/bash

sshsudo -D -c -r -v BATMAN-1.sun.com,BATMAN-2,BATMAN-3,BATMAN-4 rpm -Uvh --force --nodeps "/apps/rpms/EDGE-5.5.2-8/edge-3rdParty-5*.rpm edge-5*.rpm edge-docs-5*.rpm"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems writing script to turn off remote computers using ssh abhi6691 Linux - Newbie 7 06-25-2012 04:11 PM
Install RPM Packages but keep them separated from RPM theKbStockpiler Linux - General 6 02-05-2012 10:26 AM
Noob question regarding rpm packages for Suse 64bit Zzorrkk SUSE / openSUSE 6 11-27-2004 05:10 PM
Can I install redhat rpm packages in Suse?. linux123456 SUSE / openSUSE 6 10-16-2004 06:16 PM
RPM 'failed dependencies': Why can I not install any rpm packages? leontini Linux - Newbie 7 09-16-2003 12:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration