]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/entropy.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2005-2010 IPFire Team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
24 # enable only the following on debugging purpose
26 #use CGI::Carp 'fatalsToBrowser';
28 require '/var/ipfire/general-functions.pl';
29 require "${General::swroot}/lang.pl";
30 require "${General::swroot}/header.pl";
31 require "${General::swroot}/graphs.pl";
33 &Header
::showhttpheaders
();
34 &Header
::openpage
($Lang::tr
{'entropy'}, 1, '');
35 &Header
::openbigbox
('100%', 'left');
37 &Header
::openbox
('100%', 'center', $Lang::tr
{'entropy'});
38 &Graphs
::makegraphbox
("entropy.cgi", "entropy", "day");
41 # Check for hardware support.
43 my $message_colour = $Header::colourred
;
45 $message = $Lang::tr
{'system has rdrand'};
46 $message_colour = $Header::colourgreen
;
49 my $rngd_status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
50 if (&rngd_is_running
()) {
51 $rngd_status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
54 &Header
::openbox
('100%', 'center', $Lang::tr
{'hardware support'});
57 <p style="color: $message_colour; text-align: center;">$message</p>
62 <table width='80%' cellspacing='1' class='tbl'>
64 <th align='center'><b>$Lang::tr{'service'}</b></th>
65 <th align='center'><b>$Lang::tr{'status'}</b></th>
69 $Lang::tr{'random number generator daemon'}
77 &Header
::closebigbox
();
81 open(FILE
, "/proc/cpuinfo") or return 0;
85 my @result = grep(/rdrand/, @cpuinfo);
93 sub rngd_is_running
() {
94 return (-e
"/var/run/rngd.pid");