]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/modem-status.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
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}/modem-lib.pl";
37 &General
::readhash
("${General::swroot}/ethernet/settings", \
%ethsettings);
39 if ($ethsettings{"RED_TYPE"} eq "PPPOE") {
40 &General
::readhash
("${General::swroot}/ppp/settings", \
%pppsettings);
42 # Establish the connection to the modem.
43 my $port = $pppsettings{'MONPORT'};
46 $modem = Modem
->new($port, $pppsettings{"DTERATE"});
50 &Header
::showhttpheaders
();
51 &Header
::openpage
($Lang::tr
{'modem information'}, 1, '');
52 &Header
::openbigbox
('100%', 'left');
55 &Header
::openbox
("100%", "center", $Lang::tr
{'modem hardware details'});
62 my $vendor = $modem->get_vendor();
66 <td width="33%">$Lang::tr{'vendor'}</td>
72 my $model = $modem->get_model();
76 <td width="33%">$Lang::tr{'model'}</td>
82 my $software_version = $modem->get_software_version();
83 if ($software_version) {
86 <td width="33%">$Lang::tr{'software version'}</td>
87 <td>$software_version</td>
92 my $imei = $modem->get_imei();
96 <td width="33%">$Lang::tr{'imei'}</td>
102 my @caps = $modem->get_capabilities();
104 my $caps_string = join(", ", @caps);
108 <td width="33%">$Lang::tr{'capabilities'}</td>
109 <td>$caps_string</td>
121 &Header
::openbox
("100%", "center", $Lang::tr
{'modem sim information'});
127 my $imsi = $modem->get_sim_imsi();
131 <td width="33%">$Lang::tr{'imsi'}</td>
143 &Header
::openbox
("100%", "center", $Lang::tr
{'modem network information'});
149 my $network_registration = $modem->get_network_registration();
150 if ($network_registration) {
153 <td width="33%">$Lang::tr{'modem network registration'}</td>
154 <td>$network_registration</td>
159 my $network_operator = $modem->get_network_operator();
160 if ($network_operator) {
163 <td width="33%">$Lang::tr{'modem network operator'}</td>
164 <td>$network_operator</td>
169 my $network_mode = $modem->get_network_mode();
173 <td width="33%">$Lang::tr{'modem network mode'}</td>
174 <td>$network_mode</td>
179 my $signal_quality = $modem->get_signal_quality();
180 if ($signal_quality) {
183 <td width="33%">$Lang::tr{'modem network signal quality'}</td>
184 <td>$signal_quality dBm</td>
189 my $bit_error_rate = $modem->get_bit_error_rate();
190 if ($bit_error_rate) {
193 <td width="33%">$Lang::tr{'modem network bit error rate'}</td>
194 <td>$bit_error_rate</td>
205 &Header
::openbox
("100%", "center", $Lang::tr
{'modem no connection'});
206 print "<p>$Lang::tr{'modem no connection message'}</p>";
210 &Header
::closebigbox
();
211 &Header
::closepage
();