in reply to shuting down a linux-server
Although I agree wholeheartedly with other monk's suggestions of using ssh, I believe this will give you what you're looking for.
Dump_Log will be very useful for you as well when working through this problem. Hope this helps.#!d:/perl/bin/perl -w use strict; my $username = "dave"; my $passwd = "mypass"; my $debug = "debug"; my $root = "su"; my $rootpass = "myrootpass"; use Net::Telnet (); my $t = new Net::Telnet (Timeout => 10, Dump_Log => $debug, ); $t->open("IP address here"); $t->login($username, $passwd); $t->print($root); $t->waitfor('/Password:/'); $t->print($rootpass); $t->waitfor('/#/'); my @lines = $t->cmd("whoami"); print @lines;
cheers, -semio
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: shuting down a linux-server
by NorthenMonk (Initiate) on Oct 07, 2002 at 11:00 UTC |