#!/usr/bin/perl use strict; #use CGI qw/:standard/; #use CGI qw( :html *p); use CGI qw(:cgi-lib :standard); &ReadParse(*input); use CGI qw( :html *p); use CGI::Pretty; print header, start_html('Utilization'); my $cgi_obj = new CGI(); my $power_on = $cgi_obj->param('power_on'); my $power_off = $cgi_obj->param('power_off'); if($power_off){ Change::change_file("INFO", "$power_off", "POWER_STATUS", "OFF"); } if($power_on){ Change::change_file("INFO", "$power_on", "POWER_STATUS", "ON"); } my $h = "

System Management Page

"; $h .= "\n\n";

$h .= "\n"; $h .= "\n"; $h .= "\n"; $h .= "\n"; $h .= "\n"; $h .= "";

open(my $FH,"INFO") or die ("$!");

my $ref={};

my $i = 1;

while(<$FH>){

my ($NAME,$IP,$POWER_OFF_ON,$USED_STATE)=split(/,/);

$h .= ""; $h .= ""; $h .= ""; $h .= ""; if ( $POWER_OFF_ON eq "OFF"){ $h .= "
"; $h .= ""; $h .= ""; $i++; } print "$h"; print $cgi_obj->end_html(); exit;
Serial No.
NAME
IP
State_ON_OFF
Used state
$i.
$NAME
$IP
$POWER_OFF_ON
"; $h .= ""; $h .= "
"; $h .= ""; } else { $h .= "

"; $h .= "
$POWER_OFF_ON
"; $h .= ""; $h .= "
"; $h .= ""; } $h .= "
$USED_STATE