FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 11-17-2010, 07:08 PM
"Brunner, Brian T."
 
Default good shell script examples?

> -----Original Message-----
> From: centos-bounces@centos.org
> [mailto:centos-bounces@centos.org] On Behalf Of Kill Script
> Sent: Monday, November 15, 2010 9:06 PM
> To: CentOS mailing list
> Subject: Re: [CentOS] good shell script examples?
>
> I wrote a simple one a few years back:
> > http://www.happyhacker.org/gtmhh/basha.shtml

Is there an alternate location for this? My corp's "websense" blocks
this site for some reason.

> This is great! Thanks for sharing.
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
************************************************** *****************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This footnote also confirms that this
email message has been swept for the presence of computer viruses.
www.Hubbell.com - Hubbell Incorporated**

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-17-2010, 07:40 PM
John Kennedy
 
Default good shell script examples?

On Wed, Nov 17, 2010 at 15:08, Brunner, Brian T. <BBrunner@gai-tronics.com> wrote:






> -----Original Message-----

> From: centos-bounces@centos.org

> [mailto:centos-bounces@centos.org] On Behalf Of Kill Script

> Sent: Monday, November 15, 2010 9:06 PM

> To: CentOS mailing list

> Subject: Re: [CentOS] good shell script examples?

>

> I wrote a simple one a few years back:

> > http://www.happyhacker.org/gtmhh/basha.shtml



Is there an alternate location for this? *My corp's "websense" blocks

this site for some reason.



They probably only want sad hackers...John*
--
*John Kennedy


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-26-2010, 07:49 AM
Michael Gliwinski
 
Default good shell script examples?

On Wednesday 17 Nov 2010 07:47:17 洪 川 wrote:
> #!/bin/bash
>
>
> H="
> 192.168.1.1
> 192.168.1.2
> 192.168.1.3
> 192.168.1.4
> "
>
>
> for i in $H ; do
> expect << -EOF-
> set timeout 2
> spawn scp ${rootidfile} root@${host}:/tmp/id_file
> expect "d:"
> send "${password}
"
> expect eof
> spawn ssh ${host}
> expect "d:"
> send "${password}
"
> expect "#"
> send "mkdir -p /root/.ssh; chmod 700 /root/.ssh
"
> expect "#"
> send "cat /tmp/id_file >> /root/.ssh/authorized_keys
"
> expect "#"
> send "rm -f /tmp/id_file; exit
"
> expect eof
> -EOF-
>
> done

Or have a look at Fabric [1] which deals with SSH, sudo, passwords, etc. and
multiple hosts so it would be a matter of:

@hosts('192.168.1.1', '192.168.1.2', '192.168.1.3', '192.168.1.4')
def some_task():
put('rootidfile', '~/.ssh/authorized_keys')

and run it as:

$ fab -U root some_task


[1] http://fabfile.org/


--
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319

************************************************** ********************************************
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract.
If you have received this email in error please notify support@henderson-group.com

John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
************************************************** *******************************

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 01:19 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org