/[cvs]/nfo/perl/scripts/sshwrap/sshwrap.pl
ViewVC logotype

Diff of /nfo/perl/scripts/sshwrap/sshwrap.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Mon Jan 20 19:01:04 2003 UTC revision 1.2 by joko, Mon Jan 20 19:05:05 2003 UTC
# Line 30  Line 30 
30    
31  # cvs change history  # cvs change history
32  # $Log$  # $Log$
33  # Revision 1.1  2003/01/20 19:01:04  joko  # Revision 1.2  2003/01/20 19:05:05  joko
34  # + initial check-in  # + updates
35  #  #
36    
   
37  use strict;  use strict;
38  use warnings;  use warnings;
39    
40  use Data::Dumper;  use Data::Dumper;
 #use Shell::SSH;  
41  use lib '.';  use lib '.';
42  use Shell::SSH qw( echo hostname );  #use Shell::SSH qw( echo hostname );
43    use Shell::SSH;
44    
45  # defaults:  # defaults:
46  # - method=ssh, options=proxy_enabled=0  # - method=ssh, options=proxy_enabled=0
47  # - uses defaults proxy if proxy_enabled=1 and proxy_host is empty  # - uses defaults proxy if proxy_enabled=1 and proxy_host is empty
48  my $command = Shell::SSH->new(  my $command = Shell::SSH->new(
49      #method => 'ssh',      #method => 'ssh',
50      #target => 'test@webpla.net',      #method => './tester.sh',
51      target => 'test@netfrag.org',      target => 'test@webpla.net',
52        #target => 'test@netfrag.org',
53      args => [],      args => [],
54      #options => { proxy_enabled => 1, proxy_host => 'your-proxy.com:8080' } ,      #options => { proxy_enabled => 1, proxy_host => 'your-proxy.com:8080' } ,
55      #options => { proxy_enabled => 1 } ,      #options => { proxy_enabled => 1 } ,
# Line 71  my $command = Shell::SSH->new( Line 71  my $command = Shell::SSH->new(
71    # TODO: return values via print "command" (Shell::SSH should block in this case)    # TODO: return values via print "command" (Shell::SSH should block in this case)
72    #print $command->hostname();    #print $command->hostname();
73    #print $command->echo("Hello World!"), "\n";    #print $command->echo("Hello World!"), "\n";
74      #print "sleeping...\n";
75      #sleep 5;
76    $command->hostname();    $command->hostname();
77    $command->echo("Hello World!");    #$command->echo("Hello World!");
78        
79    sub recieve_callback {    sub recieve_callback {
80      my $output_block = shift;      my $output_block = shift;
81      #print "output: ", $output_block;      print "output: ", $output_block, "\n";
82      print $output_block;      #print $output_block;
83    }    }
84    
85  $command->disconnect();  sleep 1;
86    
87    $command->_read_output();
88    #$command->disconnect();
89    
90    
91    
92    print "ready.", "\n";
93    exit;
94    
95    my $tgt1 = 5;
96    my $tgt2 = 10;
97    
98    my $cnt = 0;
99    while (1) {
100      print ".\n";
101      sleep(1);
102      if ($cnt == $tgt1) { $command->hostname(); }
103      if ($cnt == $tgt2) { $command->_read_output(); }
104      #$command->_read_output();
105      $cnt++;
106    }
107    
 #print "ready.", "\n";  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed