82 User Guide Integrated Lights-Out

CGI Helper Application

The following perl script is an example of a CGI helper application that allows diskette writes on Web servers that cannot perform partial writes. When using the helper application, the iLO firmware posts a request to this application with three parameters:

The file parameter contains the name of the file provided in the original URL.

The range parameter contains an inclusive range (in hexadecimal) designating where to write the data.

The data parameter contains a hexadecimal string representing the data to be written.

The helper script must transform the file parameter into a path relative to its working directory. This function might involve prefixing it with "../," or it might involve transforming an aliased URL path into the true path on the file system. The helper script requires write access to the target file. Diskette image files must have the appropriate permissions.

Example:

#!/usr/bin/perl

use CGI; use Fcntl;

#

#The prefix is used to get from the current working

#directory to the location of the image file#

my ($prefix) = "..";

my ($start, $end, $len, $decode);

# Get CGI data

my $q = new CGI();

# Get file to be written

my $file = $q->param('file');

# Byte range

$range = $q->param('range');

# And the data