summaryrefslogtreecommitdiffstats
path: root/INF/ILO5.pm
diff options
context:
space:
mode:
Diffstat (limited to 'INF/ILO5.pm')
-rw-r--r--INF/ILO5.pm29
1 files changed, 13 insertions, 16 deletions
diff --git a/INF/ILO5.pm b/INF/ILO5.pm
index a2d68b6..f406762 100644
--- a/INF/ILO5.pm
+++ b/INF/ILO5.pm
@@ -105,7 +105,7 @@ sub setup_port_proxy($$$$) {
sub proxy($$$) {
my ( $self, $req, $res ) = @_;
- my $suri = $req->uri->as_string;
+ my $suri = $req->uri->as_string;
print STDERR "proxying $suri\n";
@@ -129,23 +129,22 @@ sub proxy($$$) {
return;
}
-# print STDERR "fish: ",Dumper($req->headers),"\n";
+ # print STDERR "fish: ",Dumper($req->headers),"\n";
my $proxy_req =
HTTP::Request->new( $req->method, $self->{ilo_url} . $req->uri->as_string,
[], $req->content );
- $proxy_req->header( 'cookie' => 'sessionKey=' . $self->{skey} );
- $proxy_req->header( 'x-auth-token' => $self->{skey} );
+ $proxy_req->header( 'cookie' => 'sessionKey=' . $self->{skey} );
+ $proxy_req->header( 'x-auth-token' => $self->{skey} );
-# print STDERR "soup: ",Dumper($proxy_req->headers),"\n";
+ # print STDERR "soup: ",Dumper($proxy_req->headers),"\n";
#sessionLang=en; externalIrc=ircLocation=/redfish/v1/SessionService/Sessions/administrator0000000060db1eb3cdd2f1a9/
#Location=/redfish/v1/SessionService/Sessions/uxen00000000612e3f404189374c/;
#UserPref=html5_statbar=true%2Ckbd_type=en
#irc=last=jrc
-
my $proxy_res = $self->{ua}->request($proxy_req);
unless ( $proxy_res->is_success ) {
@@ -163,7 +162,7 @@ sub proxy($$$) {
if ( $req->uri->as_string =~ /^\/redfish\/v1\/Managers\/1\/RcInfo/ ) {
- print "content: $content\n";
+ print "content: $content\n";
my $local_port = int( rand(30000) ) + 30000;
@@ -171,7 +170,7 @@ sub proxy($$$) {
push @{ $self->{to_kill} },
$self->setup_port_proxy( $local_port, $self->{host}, $1 );
- print "FISH $1 -> $local_port\n";
+ print "FISH $1 -> $local_port\n";
$local_port = int( rand(30000) ) + 30000;
@@ -179,7 +178,7 @@ sub proxy($$$) {
push @{ $self->{to_kill} },
$self->setup_port_proxy( $local_port, $self->{host}, $1 );
- print "SOUP $1 -> $local_port\n";
+ print "SOUP $1 -> $local_port\n";
}
@@ -211,11 +210,10 @@ sub login($) {
$self->{skey} = undef;
return -1;
}
- print STDERR "Login good!\n";
+ print STDERR "Login good!\n";
my $json = decode_json( $res->content );
-
$self->{skey} = $json->{session_key};
# print "Session key ".$self->{skey}."\n";
@@ -228,7 +226,10 @@ sub view($) {
$self->login() unless defined $self->{skey};
- my $get = GET( $self->{ilo_url} . '/html/java_irc.html?lang=en', 'Cookie' => 'sessionKey=' . $self->{skey} );
+ my $get = GET(
+ $self->{ilo_url} . '/html/java_irc.html?lang=en',
+ 'Cookie' => 'sessionKey=' . $self->{skey}
+ );
my $res = $self->{ua}->request($get);
@@ -243,7 +244,6 @@ sub view($) {
return -1;
}
-
$content = $1;
#$content=~ s/document.writeln\("(.*)"\);$/\1/m;
@@ -261,9 +261,6 @@ sub view($) {
print $content;
-
-
-
my $webserver_pid = fork();
if ( $webserver_pid == 0 ) {