Solved - Re: [gentoo-user] autoexpect?

2005-11-27 Thread Antoine

Walter Dnes wrote:

On Fri, Nov 25, 2005 at 08:00:09PM +0100, Andres Becerra Sandoval wrote



If you create a private-public pair with ssh-keygen you can access to
the other machine without a password. Then your script would call ssh
and probably "sudo /sbin/poweroff" as a parameter to halt the remote
machine.


Thanks for all your suggestions, as I basically wanted to create an icon 
on the desktop to turn off the firewall/server, I went with expect. I 
also discovered cygwin on my journeys so am very happy - I just have a 
single script for all systems.
I didn't read the docs carefully enough, and didn't see that autoexpect 
is just a script, so downloading from the expect site + gentoo expect 
solved it for gentoo.

Cheers
Antoine
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] autoexpect?

2005-11-26 Thread Walter Dnes
On Fri, Nov 25, 2005 at 08:00:09PM +0100, Andres Becerra Sandoval wrote

> If you create a private-public pair with ssh-keygen you can access to
> the other machine without a password. Then your script would call ssh
> and probably "sudo /sbin/poweroff" as a parameter to halt the remote
> machine.

  That's exactly what I do.  I turn on my emergency system every couple
of weeks, "emerge --sync" and "emerge --ask --deep --update --world",
run etc-update if necessary and then shut down.  I have a honking big
19" CRT on my desk at home, and the KVM is used elsewhere.  The machine
name is m450 (450 mhz PIII).  My main machine is m3000 (AMD64 3000+).
There is an ordinary user "waltdnes" on m450.  /etc/sudoers on m450
contains the following line...

waltdnes  m450 = (root) NOPASSWD: /sbin/poweroff

  I have a short script ~/bin/stopm450 on m3000 ...

#!/bin/bash
ssh [EMAIL PROTECTED] sudo /sbin/poweroff

  To shut down...
  1) via ssh shut down unnecessary programs on m450
  2) exit all ssh sessions to m450
  3) stopm450

-- 
Walter Dnes <[EMAIL PROTECTED]> In linux /sbin/init is Job #1
My musings on technology and security at http://tech_sec.blog.ca
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] autoexpect?

2005-11-25 Thread Rob Oravec
On Fri, 2005-11-25 at 19:44 +0100, Antoine wrote:
> Hi,
> I would like to write a script to log in to a network machine and run 
> halt (for the missus, who doesn't really like logging in via ssh just to 
> turn of the internet connection...), and saw that autoexpect looks like 
> it would fit the bill. It doesn't seem to be in portage and it seems a 
> lot more difficult with expect...
> Any ideas?
> Cheers
> Antoine

Hi,

I haven't used autoexpect but have Expect.
Here is a link that you may have seen but will do what you would
"expect"...pardon the pun.

Perl with Expect module or Just Expect on its own.

http://www.infocopter.com/perl_corner/expect.htm

Hope this helps,

Rob



signature.asc
Description: This is a digitally signed message part


Re: [gentoo-user] autoexpect?

2005-11-25 Thread Andres Becerra Sandoval
Hello,

If you create a private-public pair with ssh-keygen you can access to
the other machine without a password. Then your script would call ssh
and probably "sudo /sbin/poweroff" as a parameter to halt the remote
machine.


On 11/25/05, Antoine <[EMAIL PROTECTED]> wrote:
> Hi,
> I would like to write a script to log in to a network machine and run
> halt (for the missus, who doesn't really like logging in via ssh just to
> turn of the internet connection...), and saw that autoexpect looks like
> it would fit the bill. It doesn't seem to be in portage and it seems a
> lot more difficult with expect...
> Any ideas?
> Cheers
> Antoine
> --
> gentoo-user@gentoo.org mailing list
>
>


--
Andres Becerra Sandoval

-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] autoexpect?

2005-11-25 Thread Antoine

Hi,
I would like to write a script to log in to a network machine and run 
halt (for the missus, who doesn't really like logging in via ssh just to 
turn of the internet connection...), and saw that autoexpect looks like 
it would fit the bill. It doesn't seem to be in portage and it seems a 
lot more difficult with expect...

Any ideas?
Cheers
Antoine
--
gentoo-user@gentoo.org mailing list