--- nfo/perl/scripts/sshwrap/sshwrap.pl 2003/01/20 19:01:04 1.1 +++ nfo/perl/scripts/sshwrap/sshwrap.pl 2003/01/20 19:05:05 1.2 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: sshwrap.pl,v 1.1 2003/01/20 19:01:04 joko Exp $ +# $Id: sshwrap.pl,v 1.2 2003/01/20 19:05:05 joko Exp $ =pod @@ -30,26 +30,26 @@ # cvs change history # $Log: sshwrap.pl,v $ -# Revision 1.1 2003/01/20 19:01:04 joko -# + initial check-in +# Revision 1.2 2003/01/20 19:05:05 joko +# + updates # - use strict; use warnings; use Data::Dumper; -#use Shell::SSH; use lib '.'; -use Shell::SSH qw( echo hostname ); +#use Shell::SSH qw( echo hostname ); +use Shell::SSH; # defaults: # - method=ssh, options=proxy_enabled=0 # - uses defaults proxy if proxy_enabled=1 and proxy_host is empty my $command = Shell::SSH->new( #method => 'ssh', - #target => 'test@webpla.net', - target => 'test@netfrag.org', + #method => './tester.sh', + target => 'test@webpla.net', + #target => 'test@netfrag.org', args => [], #options => { proxy_enabled => 1, proxy_host => 'your-proxy.com:8080' } , #options => { proxy_enabled => 1 } , @@ -71,15 +71,37 @@ # TODO: return values via print "command" (Shell::SSH should block in this case) #print $command->hostname(); #print $command->echo("Hello World!"), "\n"; + #print "sleeping...\n"; + #sleep 5; $command->hostname(); - $command->echo("Hello World!"); + #$command->echo("Hello World!"); sub recieve_callback { my $output_block = shift; - #print "output: ", $output_block; - print $output_block; + print "output: ", $output_block, "\n"; + #print $output_block; } -$command->disconnect(); +sleep 1; + +$command->_read_output(); +#$command->disconnect(); + + + +print "ready.", "\n"; +exit; + +my $tgt1 = 5; +my $tgt2 = 10; + +my $cnt = 0; +while (1) { + print ".\n"; + sleep(1); + if ($cnt == $tgt1) { $command->hostname(); } + if ($cnt == $tgt2) { $command->_read_output(); } + #$command->_read_output(); + $cnt++; +} -#print "ready.", "\n";