mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-09 08:48:27 +02:00
SMT: Show status on vulnerabilities.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -170,12 +170,20 @@ print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
|
||||
|
||||
&Header::openbox('100%', 'center', $Lang::tr{'settings'});
|
||||
|
||||
my $smt_status = &smt_status();
|
||||
|
||||
print <<END;
|
||||
<table class="tbl" width="66%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2" align="center">
|
||||
<strong>$smt_status</strong>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="50%" align="left">
|
||||
<strong>$Lang::tr{'enable smt'}</strong>
|
||||
$Lang::tr{'enable smt'}
|
||||
</td>
|
||||
|
||||
<td width="50%" align="center">
|
||||
@@ -222,3 +230,21 @@ sub check_status($) {
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
sub smt_status() {
|
||||
open(FILE, "/sys/devices/system/cpu/smt/control");
|
||||
my $status = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
chomp($status);
|
||||
|
||||
if ($status eq "on") {
|
||||
return $Lang::tr{'smt enabled'};
|
||||
} elsif (($status eq "off") || ($status eq "forceoff")) {
|
||||
return $Lang::tr{'smt disabled'};
|
||||
} elsif ($status eq "notsupported") {
|
||||
return $Lang::tr{'smt not supported'};
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user