+
+ | $Lang::tr{'services'} |
+ $Lang::tr{'status'} |
+ PID |
+ $Lang::tr{'memory'} |
+
END
;
my $key = '';
+ my $col="";
foreach $key (sort keys %servicenames){
$lines++;
if ($lines % 2){
- print "\n| ";
+ $col="bgcolor='$color{'color22'}'";
+ print " |
| ";
print $link{$key};
- print " | \n";
+ print "";
}else{
- print "
\n| ";
+ $col="bgcolor='$color{'color20'}'";
+ print " |
| ";
print $link{$key};
- print " | \n";
+ print "";
}
my $shortname = $servicenames{$key};
- my $status = &isrunning($shortname);
+ my $status = &isrunning($shortname,$col);
print "$status\n";
print "
\n";
@@ -152,14 +160,14 @@ END
print <
-
+
-| Addon |
-Boot |
-$Lang::tr{'action'} |
-$Lang::tr{'status'} |
-PID |
-$Lang::tr{'memory'} |
+ Addon |
+ Boot |
+ $Lang::tr{'action'} |
+ $Lang::tr{'status'} |
+ PID |
+ $Lang::tr{'memory'} |
END
;
@@ -183,16 +191,18 @@ END
if ( ($_ ne "alsa") && ($_ ne "mdadm") ) {
$lines++;
if ($lines % 2){
- print "";
+ print "
";
+ $col="bgcolor='$color{'color22'}'";
}else{
- print "
";
+ print "
";
+ $col="bgcolor='$color{'color20'}'";
}
- print "| $_ | ";
- my $status = isautorun($_);
+ print "$_ | ";
+ my $status = isautorun($_,$col);
print "$status ";
- print " | ";
- print " | ";
- my $status = &isrunningaddon($_);
+ print " | ";
+ print " | ";
+ my $status = &isrunningaddon($_,$col);
$status =~ s/\\[[0-1]\;[0-9]+m//g;
chomp($status);
@@ -219,16 +229,17 @@ END
sub isautorun{
my $cmd = $_[0];
- my $status = " | ";
+ my $col = $_[1];
+ my $status = " | ";
my $init = `find /etc/rc.d/rc3.d/S??${cmd} 2>/dev/null`;
chomp ($init);
if ($init ne ''){
- $status = " | ";
+ $status = " | ";
}
$init = `find /etc/rc.d/rc3.d/off/S??${cmd} 2>/dev/null`;
chomp ($init);
if ($init ne ''){
- $status = " | ";
+ $status = " | ";
}
return $status;
@@ -236,7 +247,8 @@ sub isautorun{
sub isrunning{
my $cmd = $_[0];
- my $status = "$Lang::tr{'stopped'} | | ";
+ my $col = $_[1];
+ my $status = "$Lang::tr{'stopped'} | | ";
my $pid = '';
my $testcmd = '';
my $exename;
@@ -267,7 +279,7 @@ sub isrunning{
close(FILE);
}
if ($testcmd =~ /$exename/){
- $status = "$Lang::tr{'running'} | $pid | $memory | ";
+ $status = "$Lang::tr{'running'} | $pid | $memory | ";
}
}
return $status;
@@ -275,7 +287,8 @@ sub isrunning{
sub isrunningaddon{
my $cmd = $_[0];
- my $status = "$Lang::tr{'stopped'} | | ";
+ my $col = $_[1];
+ my $status = "$Lang::tr{'stopped'} | | ";
my $pid = '';
my $testcmd = '';
my $exename;
@@ -293,7 +306,7 @@ sub isrunningaddon{
$testcmd =~ s///gi;
my @pid = split(/\s/,$testcmd);
- $status .="$pid[0] | ";
+ $status .="$pid[0] | ";
my $memory = 0;
@@ -305,9 +318,9 @@ sub isrunningaddon{
}
$memory+=$memory[0];
}
- $status .="$memory KB | ";
+ $status .="$memory KB | ";
}else{
- $status = "$Lang::tr{'stopped'} | | ";
+ $status = "$Lang::tr{'stopped'} | | ";
}
return $status;
}