From c5e3d520e92aee074f1713f8ba98ee4296341ad3 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 16 Apr 2014 01:26:28 +0200 Subject: [PATCH] Add modem status page. On this page, much useful information is displayed about the hardware and the status of an LTE/3G or other kinds of modems that respond to AT commands. --- config/cfgroot/header.pl | 4 + config/cfgroot/modem-lib.pl | 276 ++++++++++++++++++ config/menu/20-status.menu | 5 + config/rootfiles/common/apache2 | 1 + config/rootfiles/common/configroot | 1 + config/rootfiles/common/perl-Device-Modem | 18 ++ .../rootfiles/common/perl-Device-SerialPort | 10 + doc/language_issues.de | 1 + doc/language_issues.en | 1 + doc/language_issues.es | 19 ++ doc/language_issues.fr | 19 ++ doc/language_issues.nl | 19 ++ doc/language_issues.pl | 19 ++ doc/language_issues.ru | 19 ++ doc/language_issues.tr | 19 ++ doc/language_missings | 72 +++++ html/cgi-bin/modem-status.cgi | 211 +++++++++++++ html/cgi-bin/pppsetup.cgi | 29 ++ langs/de/cgi-bin/de.pl | 18 ++ langs/en/cgi-bin/en.pl | 18 ++ lfs/configroot | 1 + lfs/perl-Device-Modem | 77 +++++ lfs/perl-Device-SerialPort | 77 +++++ make.sh | 2 + 24 files changed, 936 insertions(+) create mode 100644 config/cfgroot/modem-lib.pl create mode 100644 config/rootfiles/common/perl-Device-Modem create mode 100644 config/rootfiles/common/perl-Device-SerialPort create mode 100755 html/cgi-bin/modem-status.cgi create mode 100644 lfs/perl-Device-Modem create mode 100644 lfs/perl-Device-SerialPort diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 39472a857..bbb7e21f4 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -153,6 +153,10 @@ sub genmenu { if (&General::RedIsWireless()) { $menu->{'01.system'}{'subMenu'}->{'21.wlan'}{'enabled'} = 1; } + + if ($ethsettings{'RED_TYPE'} eq "PPPOE") { + $menu->{'02.status'}{'subMenu'}->{'74.modem-status'}{'enabled'} = 1; + } } sub showhttpheaders diff --git a/config/cfgroot/modem-lib.pl b/config/cfgroot/modem-lib.pl new file mode 100644 index 000000000..51b6d68e9 --- /dev/null +++ b/config/cfgroot/modem-lib.pl @@ -0,0 +1,276 @@ +#!/usr/bin/perl +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2014 IPFire Team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +use Device::Modem; + +package Modem; + +sub new() { + my $class = shift; + + my $port = shift; + my $baud = shift; + + my $self = {}; + bless $self, $class; + + # Initialize the connetion to the modem. + $self->_initialize($port, $baud); + + if ($self->_is_working()) { + return $self; + } + + return undef; +} + +sub DESTROY() { + my $self = shift; + + # Close connection to modem. + if ($self->{modem}) { + $self->{modem}->close(); + } +} + +sub _initialize() { + my ($self, $port, $baud) = @_; + + # Establish connection to the modem. + $self->{modem} = new Device::Modem(port => $port); + $self->{modem}->connect(baudrate => $baud); +} + +sub _is_working() { + my $self = shift; + + # Check if the modem responds to AT commands. + $self->{modem}->atsend("AT\r\n"); + + my $response = $self->{modem}->answer(); + return ($response eq "OK"); +} + +sub _command() { + my $self = shift; + my $cmd = shift; + + # Terminate the AT command with newline. + $cmd .= "\r\n"; + + $self->{modem}->atsend($cmd); + + my $response = $self->{modem}->answer(); + my @response = split(/\n/, $response); + + # Trim leading and trailing spaces. + foreach my $line (@response) { + $line =~ s/^\s+|\s+$//g; + chomp($line); + } + + my $last_element = pop(@response); + unless ($last_element eq "OK") { + push(@response, $last_element); + } + + $response = join("\n", @response); + + return $self->_trim($response); +} + +sub _trim() { + my $self = shift; + my $input = shift; + + my $first_char = substr($input, 0, 1); + if ($first_char eq "+") { + my @output = split(/:/, $input); + if ($#output == 1) { + return $output[1]; + } + } + + return $input; +} + +sub get_vendor() { + my $self = shift; + + return $self->_command("AT+GMI"); +} + +sub get_model() { + my $self = shift; + + return $self->_command("AT+GMM"); +} + +sub get_software_version() { + my $self = shift; + + return $self->_command("AT+GMR"); +} + +sub get_imei() { + my $self = shift; + + return $self->_command("AT+GSN"); +} + +sub get_capabilities() { + my $self = shift; + + my $output = $self->_command("AT+GCAP"); + return split(/,/, $output); +} + +sub is_sim_unlocked() { + my $self = shift; + + # TODO + return 1; +} + +sub get_sim_imsi() { + my $self = shift; + + if ($self->is_sim_unlocked()) { + return $self->_command("AT+CIMI"); + } +} + +sub get_network_registration() { + my $self = shift; + + my @elements; + foreach my $i ([0, 1]) { + my $output = $self->_command("AT+CREG?"); + + @elements = split(/,/, $output); + if ($#elements != 2) { + # Output in wrong format. Resetting. + $self->_command("AT+CREG=0"); + } + } + + if ($elements[0] == 0) { + if ($elements[1] == 0) { + return "NOT REGISTERED, NOT SEARCHING"; + } elsif ($elements[1] == 1) { + return "REGISTERED TO HOME NETWORK"; + } elsif ($elements[1] == 2) { + return "NOT REGISTERED, SEARCHING"; + } elsif ($elements[1] == 3) { + return "REGISTRATION DENIED"; + } elsif ($elements[1] == 5) { + return "REGISTERED, ROAMING"; + } else { + return "UNKNOWN"; + } + } +} + +sub _get_network_operator() { + my $self = shift; + + my $output = $self->_command("AT+COPS?"); + $output =~ s/\"//g; + + my @elements = split(/,/, $output); + if ($#elements == 3) { + return @elements; + } +} + +sub get_network_operator() { + my $self = shift; + + my ($mode, $format, $operator, $act) = $self->_get_network_operator(); + + return $operator; +} + +sub get_network_mode() { + my $self = shift; + + my ($mode, $format, $operator, $act) = $self->_get_network_operator(); + + if ($act == 0) { + return "GSM"; + } elsif ($act == 1) { + return "Compact GSM"; + } elsif ($act == 2) { + return "UMTS"; + } elsif ($act == 3) { + return "GSM WITH EGPRS"; + } elsif ($act == 4) { + return "UMTS WITH HSDPA"; + } elsif ($act == 5) { + return "UMTS WITH HSUPA"; + } elsif ($act == 6) { + return "UMTS WITH HSDPA+HSUPA"; + } elsif ($act == 7) { + return "LTE"; + } else { + return "UNKNOWN ($act)"; + } +} + +sub _get_signal_quality() { + my $self = shift; + + my $output = $self->_command("AT+CSQ"); + + my @elements = split(/,/, $output); + if ($#elements == 1) { + return @elements; + } +} + +sub get_signal_quality() { + my $self = shift; + + my ($rssi, $ber) = $self->_get_signal_quality(); + + # 99 equals unknown. + unless ($rssi == 99) { + my $dbm = ($rssi * 2) - 113; + return $dbm; + } + + return undef; +} + +sub get_bit_error_rate() { + my $self = shift; + + my ($rssi, $ber) = $self->_get_signal_quality(); + + # 99 indicates unknown. + unless ($ber == 99) { + return $ber; + } + + return undef; +} + +1; diff --git a/config/menu/20-status.menu b/config/menu/20-status.menu index 8899310aa..b159ed610 100644 --- a/config/menu/20-status.menu +++ b/config/menu/20-status.menu @@ -70,6 +70,11 @@ 'title' => "$Lang::tr{'qos graphs'}", 'enabled' => 1, }; + $substatus->{'74.modem-status'} = {'caption' => $Lang::tr{'modem status'}, + 'uri' => '/cgi-bin/modem-status.cgi', + 'title' => $Lang::tr{'modem status'}, + 'enabled' => 0, + }; $substatus->{'75.atm-status'} = {'caption' => 'Atm-status', 'uri' => '/cgi-bin/atm-status.cgi', 'title' => 'Atm-status', diff --git a/config/rootfiles/common/apache2 b/config/rootfiles/common/apache2 index 2dd14cc2c..474e7a7dc 100644 --- a/config/rootfiles/common/apache2 +++ b/config/rootfiles/common/apache2 @@ -1415,6 +1415,7 @@ srv/web/ipfire/cgi-bin/mac.cgi srv/web/ipfire/cgi-bin/media.cgi srv/web/ipfire/cgi-bin/memory.cgi srv/web/ipfire/cgi-bin/modem.cgi +srv/web/ipfire/cgi-bin/modem-status.cgi srv/web/ipfire/cgi-bin/netexternal.cgi srv/web/ipfire/cgi-bin/netinternal.cgi srv/web/ipfire/cgi-bin/netother.cgi diff --git a/config/rootfiles/common/configroot b/config/rootfiles/common/configroot index b5de9891d..6afe6cdf8 100644 --- a/config/rootfiles/common/configroot +++ b/config/rootfiles/common/configroot @@ -116,6 +116,7 @@ var/ipfire/menu.d/70-log.menu var/ipfire/modem #var/ipfire/modem/defaults #var/ipfire/modem/settings +var/ipfire/modem-lib.pl var/ipfire/net-traffic #var/ipfire/net-traffic/net-traffic-admin.pl #var/ipfire/net-traffic/net-traffic-lib.pl diff --git a/config/rootfiles/common/perl-Device-Modem b/config/rootfiles/common/perl-Device-Modem new file mode 100644 index 000000000..9e8da1c39 --- /dev/null +++ b/config/rootfiles/common/perl-Device-Modem @@ -0,0 +1,18 @@ +#usr/lib/perl5/site_perl/5.12.3/Device +#usr/lib/perl5/site_perl/5.12.3/Device/Modem +usr/lib/perl5/site_perl/5.12.3/Device/Modem.pm +#usr/lib/perl5/site_perl/5.12.3/Device/Modem/FAQ.pod +#usr/lib/perl5/site_perl/5.12.3/Device/Modem/Log +usr/lib/perl5/site_perl/5.12.3/Device/Modem/Log/File.pm +usr/lib/perl5/site_perl/5.12.3/Device/Modem/Log/Syslog.pm +#usr/lib/perl5/site_perl/5.12.3/Device/Modem/Protocol +usr/lib/perl5/site_perl/5.12.3/Device/Modem/Protocol/Xmodem.pm +usr/lib/perl5/site_perl/5.12.3/Device/Modem/UsRobotics.pm +#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device/Modem +#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device/Modem/.packlist +#usr/share/man/man3/Device::Modem.3 +#usr/share/man/man3/Device::Modem::FAQ.3 +#usr/share/man/man3/Device::Modem::Log::File.3 +#usr/share/man/man3/Device::Modem::Log::Syslog.3 +#usr/share/man/man3/Device::Modem::Protocol::Xmodem.3 +#usr/share/man/man3/Device::Modem::UsRobotics.3 diff --git a/config/rootfiles/common/perl-Device-SerialPort b/config/rootfiles/common/perl-Device-SerialPort new file mode 100644 index 000000000..dccc42588 --- /dev/null +++ b/config/rootfiles/common/perl-Device-SerialPort @@ -0,0 +1,10 @@ +#usr/bin/modemtest +usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/Device +usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/Device/SerialPort.pm +#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device +#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device/SerialPort +#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device/SerialPort/.packlist +#usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device/SerialPort/SerialPort.bs +usr/lib/perl5/site_perl/5.12.3/MACHINE-linux-thread-multi/auto/Device/SerialPort/SerialPort.so +#usr/share/man/man1/modemtest.1 +#usr/share/man/man3/Device::SerialPort.3 diff --git a/doc/language_issues.de b/doc/language_issues.de index 486ecba0d..32deb0954 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -613,6 +613,7 @@ WARNING: untranslated string: community rules WARNING: untranslated string: dead peer detection WARNING: untranslated string: emerging rules WARNING: untranslated string: fwhost err hostip +WARNING: untranslated string: monitor interface WARNING: untranslated string: qos add subclass WARNING: untranslated string: route config changed WARNING: untranslated string: routing config added diff --git a/doc/language_issues.en b/doc/language_issues.en index e968b591a..4e15460fd 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -643,6 +643,7 @@ WARNING: translation string unused: yearly firewallhits WARNING: untranslated string: Scan for Songs WARNING: untranslated string: bytes WARNING: untranslated string: fwhost err hostip +WARNING: untranslated string: monitor interface WARNING: untranslated string: route config changed WARNING: untranslated string: routing config added WARNING: untranslated string: routing config changed diff --git a/doc/language_issues.es b/doc/language_issues.es index dbccd8f58..d99937501 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -591,6 +591,7 @@ WARNING: untranslated string: advproxy proxy port transparent WARNING: untranslated string: attention WARNING: untranslated string: bit WARNING: untranslated string: bytes +WARNING: untranslated string: capabilities WARNING: untranslated string: ccd add WARNING: untranslated string: ccd choose net WARNING: untranslated string: ccd client options @@ -821,6 +822,8 @@ WARNING: untranslated string: fwhost used WARNING: untranslated string: fwhost welcome WARNING: untranslated string: grouptype WARNING: untranslated string: hardware support +WARNING: untranslated string: imei +WARNING: untranslated string: imsi WARNING: untranslated string: incoming firewall access WARNING: untranslated string: integrity WARNING: untranslated string: invalid input for dpd delay @@ -834,6 +837,20 @@ WARNING: untranslated string: mac filter WARNING: untranslated string: maximum WARNING: untranslated string: minimum WARNING: untranslated string: minute +WARNING: untranslated string: model +WARNING: untranslated string: modem hardware details +WARNING: untranslated string: modem information +WARNING: untranslated string: modem network bit error rate +WARNING: untranslated string: modem network information +WARNING: untranslated string: modem network mode +WARNING: untranslated string: modem network operator +WARNING: untranslated string: modem network registration +WARNING: untranslated string: modem network signal quality +WARNING: untranslated string: modem no connection +WARNING: untranslated string: modem no connection message +WARNING: untranslated string: modem sim information +WARNING: untranslated string: modem status +WARNING: untranslated string: monitor interface WARNING: untranslated string: most preferred WARNING: untranslated string: no hardware random number generator WARNING: untranslated string: notice @@ -880,6 +897,7 @@ WARNING: untranslated string: routing config changed WARNING: untranslated string: routing table WARNING: untranslated string: server restart WARNING: untranslated string: snat new source ip address +WARNING: untranslated string: software version WARNING: untranslated string: ssh WARNING: untranslated string: static routes WARNING: untranslated string: support donation @@ -937,6 +955,7 @@ WARNING: untranslated string: tor use exit nodes WARNING: untranslated string: uplink WARNING: untranslated string: uptime load average WARNING: untranslated string: urlfilter redirect template +WARNING: untranslated string: vendor WARNING: untranslated string: visit us at WARNING: untranslated string: vpn keyexchange WARNING: untranslated string: wlan client diff --git a/doc/language_issues.fr b/doc/language_issues.fr index 4acdaf485..219567664 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -601,6 +601,7 @@ WARNING: untranslated string: advproxy proxy port transparent WARNING: untranslated string: attention WARNING: untranslated string: bit WARNING: untranslated string: bytes +WARNING: untranslated string: capabilities WARNING: untranslated string: ccd add WARNING: untranslated string: ccd choose net WARNING: untranslated string: ccd client options @@ -832,6 +833,8 @@ WARNING: untranslated string: fwhost used WARNING: untranslated string: fwhost welcome WARNING: untranslated string: grouptype WARNING: untranslated string: hardware support +WARNING: untranslated string: imei +WARNING: untranslated string: imsi WARNING: untranslated string: incoming firewall access WARNING: untranslated string: integrity WARNING: untranslated string: invalid input for dpd delay @@ -845,6 +848,20 @@ WARNING: untranslated string: mac filter WARNING: untranslated string: maximum WARNING: untranslated string: minimum WARNING: untranslated string: minute +WARNING: untranslated string: model +WARNING: untranslated string: modem hardware details +WARNING: untranslated string: modem information +WARNING: untranslated string: modem network bit error rate +WARNING: untranslated string: modem network information +WARNING: untranslated string: modem network mode +WARNING: untranslated string: modem network operator +WARNING: untranslated string: modem network registration +WARNING: untranslated string: modem network signal quality +WARNING: untranslated string: modem no connection +WARNING: untranslated string: modem no connection message +WARNING: untranslated string: modem sim information +WARNING: untranslated string: modem status +WARNING: untranslated string: monitor interface WARNING: untranslated string: most preferred WARNING: untranslated string: no hardware random number generator WARNING: untranslated string: notice @@ -888,6 +905,7 @@ WARNING: untranslated string: routing table WARNING: untranslated string: server restart WARNING: untranslated string: snat new source ip address WARNING: untranslated string: snort working +WARNING: untranslated string: software version WARNING: untranslated string: ssh WARNING: untranslated string: static routes WARNING: untranslated string: support donation @@ -948,6 +966,7 @@ WARNING: untranslated string: uptime load average WARNING: untranslated string: urlfilter file ext block WARNING: untranslated string: urlfilter mode block WARNING: untranslated string: urlfilter redirect template +WARNING: untranslated string: vendor WARNING: untranslated string: visit us at WARNING: untranslated string: vpn keyexchange WARNING: untranslated string: wlan client diff --git a/doc/language_issues.nl b/doc/language_issues.nl index 949acdc39..cd54bc18e 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -602,6 +602,7 @@ WARNING: untranslated string: advproxy errmsg proxy ports equal WARNING: untranslated string: advproxy proxy port transparent WARNING: untranslated string: bit WARNING: untranslated string: bytes +WARNING: untranslated string: capabilities WARNING: untranslated string: ccd err isipsecrw WARNING: untranslated string: ccd err isovpnn2n WARNING: untranslated string: ccd iroute2 @@ -779,6 +780,8 @@ WARNING: untranslated string: fwhost used WARNING: untranslated string: fwhost welcome WARNING: untranslated string: grouptype WARNING: untranslated string: hardware support +WARNING: untranslated string: imei +WARNING: untranslated string: imsi WARNING: untranslated string: incoming firewall access WARNING: untranslated string: integrity WARNING: untranslated string: invalid input for dpd delay @@ -791,6 +794,20 @@ WARNING: untranslated string: lifetime WARNING: untranslated string: mac filter WARNING: untranslated string: maximum WARNING: untranslated string: minimum +WARNING: untranslated string: model +WARNING: untranslated string: modem hardware details +WARNING: untranslated string: modem information +WARNING: untranslated string: modem network bit error rate +WARNING: untranslated string: modem network information +WARNING: untranslated string: modem network mode +WARNING: untranslated string: modem network operator +WARNING: untranslated string: modem network registration +WARNING: untranslated string: modem network signal quality +WARNING: untranslated string: modem no connection +WARNING: untranslated string: modem no connection message +WARNING: untranslated string: modem sim information +WARNING: untranslated string: modem status +WARNING: untranslated string: monitor interface WARNING: untranslated string: most preferred WARNING: untranslated string: no hardware random number generator WARNING: untranslated string: notice @@ -808,6 +825,7 @@ WARNING: untranslated string: routing config added WARNING: untranslated string: routing config changed WARNING: untranslated string: routing table WARNING: untranslated string: snat new source ip address +WARNING: untranslated string: software version WARNING: untranslated string: ssh WARNING: untranslated string: support donation WARNING: untranslated string: system has hwrng @@ -863,6 +881,7 @@ WARNING: untranslated string: tor use exit nodes WARNING: untranslated string: uplink WARNING: untranslated string: uptime load average WARNING: untranslated string: urlfilter redirect template +WARNING: untranslated string: vendor WARNING: untranslated string: wlan client WARNING: untranslated string: wlan client advanced settings WARNING: untranslated string: wlan client and diff --git a/doc/language_issues.pl b/doc/language_issues.pl index dbccd8f58..d99937501 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -591,6 +591,7 @@ WARNING: untranslated string: advproxy proxy port transparent WARNING: untranslated string: attention WARNING: untranslated string: bit WARNING: untranslated string: bytes +WARNING: untranslated string: capabilities WARNING: untranslated string: ccd add WARNING: untranslated string: ccd choose net WARNING: untranslated string: ccd client options @@ -821,6 +822,8 @@ WARNING: untranslated string: fwhost used WARNING: untranslated string: fwhost welcome WARNING: untranslated string: grouptype WARNING: untranslated string: hardware support +WARNING: untranslated string: imei +WARNING: untranslated string: imsi WARNING: untranslated string: incoming firewall access WARNING: untranslated string: integrity WARNING: untranslated string: invalid input for dpd delay @@ -834,6 +837,20 @@ WARNING: untranslated string: mac filter WARNING: untranslated string: maximum WARNING: untranslated string: minimum WARNING: untranslated string: minute +WARNING: untranslated string: model +WARNING: untranslated string: modem hardware details +WARNING: untranslated string: modem information +WARNING: untranslated string: modem network bit error rate +WARNING: untranslated string: modem network information +WARNING: untranslated string: modem network mode +WARNING: untranslated string: modem network operator +WARNING: untranslated string: modem network registration +WARNING: untranslated string: modem network signal quality +WARNING: untranslated string: modem no connection +WARNING: untranslated string: modem no connection message +WARNING: untranslated string: modem sim information +WARNING: untranslated string: modem status +WARNING: untranslated string: monitor interface WARNING: untranslated string: most preferred WARNING: untranslated string: no hardware random number generator WARNING: untranslated string: notice @@ -880,6 +897,7 @@ WARNING: untranslated string: routing config changed WARNING: untranslated string: routing table WARNING: untranslated string: server restart WARNING: untranslated string: snat new source ip address +WARNING: untranslated string: software version WARNING: untranslated string: ssh WARNING: untranslated string: static routes WARNING: untranslated string: support donation @@ -937,6 +955,7 @@ WARNING: untranslated string: tor use exit nodes WARNING: untranslated string: uplink WARNING: untranslated string: uptime load average WARNING: untranslated string: urlfilter redirect template +WARNING: untranslated string: vendor WARNING: untranslated string: visit us at WARNING: untranslated string: vpn keyexchange WARNING: untranslated string: wlan client diff --git a/doc/language_issues.ru b/doc/language_issues.ru index e57e91e78..9821311a5 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -594,6 +594,7 @@ WARNING: untranslated string: advproxy proxy port transparent WARNING: untranslated string: attention WARNING: untranslated string: bit WARNING: untranslated string: bytes +WARNING: untranslated string: capabilities WARNING: untranslated string: ccd add WARNING: untranslated string: ccd choose net WARNING: untranslated string: ccd client options @@ -816,6 +817,8 @@ WARNING: untranslated string: fwhost used WARNING: untranslated string: fwhost welcome WARNING: untranslated string: grouptype WARNING: untranslated string: hardware support +WARNING: untranslated string: imei +WARNING: untranslated string: imsi WARNING: untranslated string: incoming firewall access WARNING: untranslated string: incoming traffic in bytes per second WARNING: untranslated string: integrity @@ -830,6 +833,20 @@ WARNING: untranslated string: mac filter WARNING: untranslated string: maximum WARNING: untranslated string: minimum WARNING: untranslated string: minute +WARNING: untranslated string: model +WARNING: untranslated string: modem hardware details +WARNING: untranslated string: modem information +WARNING: untranslated string: modem network bit error rate +WARNING: untranslated string: modem network information +WARNING: untranslated string: modem network mode +WARNING: untranslated string: modem network operator +WARNING: untranslated string: modem network registration +WARNING: untranslated string: modem network signal quality +WARNING: untranslated string: modem no connection +WARNING: untranslated string: modem no connection message +WARNING: untranslated string: modem sim information +WARNING: untranslated string: modem status +WARNING: untranslated string: monitor interface WARNING: untranslated string: most preferred WARNING: untranslated string: no hardware random number generator WARNING: untranslated string: notice @@ -870,6 +887,7 @@ WARNING: untranslated string: routing config changed WARNING: untranslated string: routing table WARNING: untranslated string: server restart WARNING: untranslated string: snat new source ip address +WARNING: untranslated string: software version WARNING: untranslated string: ssh WARNING: untranslated string: static routes WARNING: untranslated string: support donation @@ -926,6 +944,7 @@ WARNING: untranslated string: tor use exit nodes WARNING: untranslated string: uplink WARNING: untranslated string: uptime load average WARNING: untranslated string: urlfilter redirect template +WARNING: untranslated string: vendor WARNING: untranslated string: visit us at WARNING: untranslated string: vpn keyexchange WARNING: untranslated string: wlan client diff --git a/doc/language_issues.tr b/doc/language_issues.tr index 050204327..3e07adf1c 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -646,12 +646,31 @@ WARNING: untranslated string: ConnSched reboot WARNING: untranslated string: ConnSched shutdown WARNING: untranslated string: Scan for Songs WARNING: untranslated string: bytes +WARNING: untranslated string: capabilities WARNING: untranslated string: count WARNING: untranslated string: fwdfw many WARNING: untranslated string: fwhost err hostip +WARNING: untranslated string: imei +WARNING: untranslated string: imsi WARNING: untranslated string: incoming firewall access +WARNING: untranslated string: model +WARNING: untranslated string: modem hardware details +WARNING: untranslated string: modem information +WARNING: untranslated string: modem network bit error rate +WARNING: untranslated string: modem network information +WARNING: untranslated string: modem network mode +WARNING: untranslated string: modem network operator +WARNING: untranslated string: modem network registration +WARNING: untranslated string: modem network signal quality +WARNING: untranslated string: modem no connection +WARNING: untranslated string: modem no connection message +WARNING: untranslated string: modem sim information +WARNING: untranslated string: modem status +WARNING: untranslated string: monitor interface WARNING: untranslated string: outgoing firewall access WARNING: untranslated string: route config changed WARNING: untranslated string: routing config added WARNING: untranslated string: routing config changed WARNING: untranslated string: routing table +WARNING: untranslated string: software version +WARNING: untranslated string: vendor diff --git a/doc/language_missings b/doc/language_missings index 3f1f997dd..7b0a391b0 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -25,6 +25,7 @@ < age ssecond < attention < bit +< capabilities < ccd add < ccd choose net < ccd clientip @@ -295,6 +296,8 @@ < fw settings ruletable < grouptype < hardware support +< imei +< imsi < incoming firewall access < integrity < invalid input for dpd delay @@ -311,6 +314,19 @@ < MB written < minimum < minute +< model +< modem hardware details +< modem information +< modem network bit error rate +< modem network information +< modem network mode +< modem network operator +< modem network registration +< modem network signal quality +< modem no connection +< modem no connection message +< modem sim information +< modem status < most preferred < no hardware random number generator < notice @@ -352,6 +368,7 @@ < server restart < snat new source ip address < snort working +< software version < ssh < static routes < support donation @@ -420,6 +437,7 @@ < urlfilter file ext block < urlfilter mode block < urlfilter redirect template +< vendor < visit us at < vpn keyexchange < wlanap access point @@ -494,6 +512,7 @@ < Async logging enabled < attention < bit +< capabilities < ccd add < ccd choose net < ccd clientip @@ -763,6 +782,8 @@ < fw settings ruletable < grouptype < hardware support +< imei +< imsi < incoming firewall access < integrity < invalid input for dpd delay @@ -779,6 +800,19 @@ < MB written < minimum < minute +< model +< modem hardware details +< modem information +< modem network bit error rate +< modem network information +< modem network mode +< modem network operator +< modem network registration +< modem network signal quality +< modem no connection +< modem no connection message +< modem sim information +< modem status < most preferred < no hardware random number generator < notice @@ -836,6 +870,7 @@ < server restart < Set time on boot < snat new source ip address +< software version < ssh < static routes < support donation @@ -901,6 +936,7 @@ < uptime < uptime load average < urlfilter redirect template +< vendor < visit us at < vpn keyexchange < wlanap country @@ -954,6 +990,7 @@ < age ssecond < attention < bit +< capabilities < ccd add < ccd choose net < ccd clientip @@ -1215,6 +1252,8 @@ < fw settings ruletable < grouptype < hardware support +< imei +< imsi < incoming firewall access < integrity < invalid input for dpd delay @@ -1231,6 +1270,19 @@ < MB written < minimum < minute +< model +< modem hardware details +< modem information +< modem network bit error rate +< modem network information +< modem network mode +< modem network operator +< modem network registration +< modem network signal quality +< modem no connection +< modem no connection message +< modem sim information +< modem status < most preferred < no hardware random number generator < notice @@ -1273,6 +1325,7 @@ < red1 < server restart < snat new source ip address +< software version < ssh < static routes < support donation @@ -1337,6 +1390,7 @@ < uptime < uptime load average < urlfilter redirect template +< vendor < visit us at < vpn keyexchange < wlanap country @@ -1391,6 +1445,7 @@ < age ssecond < attention < bit +< capabilities < ccd add < ccd choose net < ccd clientip @@ -1657,6 +1712,8 @@ < grouptype < hardware support < hour-graph +< imei +< imsi < incoming firewall access < incoming traffic in bytes per second < integrity @@ -1674,6 +1731,19 @@ < MB written < minimum < minute +< model +< modem hardware details +< modem information +< modem network bit error rate +< modem network information +< modem network mode +< modem network operator +< modem network registration +< modem network signal quality +< modem no connection +< modem no connection message +< modem sim information +< modem status < month-graph < most preferred < no hardware random number generator @@ -1714,6 +1784,7 @@ < red1 < server restart < snat new source ip address +< software version < ssh < static routes < support donation @@ -1778,6 +1849,7 @@ < uptime < uptime load average < urlfilter redirect template +< vendor < visit us at < vpn keyexchange < week-graph diff --git a/html/cgi-bin/modem-status.cgi b/html/cgi-bin/modem-status.cgi new file mode 100755 index 000000000..d278c7720 --- /dev/null +++ b/html/cgi-bin/modem-status.cgi @@ -0,0 +1,211 @@ +#!/usr/bin/perl +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +use strict; + +# enable only the following on debugging purpose +use warnings; +use CGI::Carp 'fatalsToBrowser'; + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +require "${General::swroot}/header.pl"; +require "${General::swroot}/modem-lib.pl"; + +my $modem; +my %ethsettings = {}; +my %pppsettings = {}; + +&General::readhash("${General::swroot}/ethernet/settings", \%ethsettings); + +if ($ethsettings{"RED_TYPE"} eq "PPPOE") { + &General::readhash("${General::swroot}/ppp/settings", \%pppsettings); + + # Establish the connection to the modem. + my $port = $pppsettings{'MONPORT'}; + if ($port) { + $port = "/dev/$port"; + $modem = Modem->new($port, $pppsettings{"DTERATE"}); + } +} + +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'modem information'}, 1, ''); +&Header::openbigbox('100%', 'left'); + +if ($modem) { + &Header::openbox("100%", "center", $Lang::tr{'modem hardware details'}); + + print < + +END + + my $vendor = $modem->get_vendor(); + if ($vendor) { + print < + $Lang::tr{'vendor'} + $vendor + +END + } + + my $model = $modem->get_model(); + if ($model) { + print < + $Lang::tr{'model'} + $model + +END + } + + my $software_version = $modem->get_software_version(); + if ($software_version) { + print < + $Lang::tr{'software version'} + $software_version + +END + } + + my $imei = $modem->get_imei(); + if ($imei) { + print < + $Lang::tr{'imei'} + $imei + +END + } + + my @caps = $modem->get_capabilities(); + if (@caps) { + my $caps_string = join(", ", @caps); + + print < + $Lang::tr{'capabilities'} + $caps_string + +END + } + + print < + +END + &Header::closebox(); + + + &Header::openbox("100%", "center", $Lang::tr{'modem sim information'}); + print < + +END + + my $imsi = $modem->get_sim_imsi(); + if ($imsi) { + print < + $Lang::tr{'imsi'} + $imsi + +END + } + + print < + +END + &Header::closebox(); + + &Header::openbox("100%", "center", $Lang::tr{'modem network information'}); + print < + +END + + my $network_registration = $modem->get_network_registration(); + if ($network_registration) { + print < + $Lang::tr{'modem network registration'} + $network_registration + +END + } + + my $network_operator = $modem->get_network_operator(); + if ($network_operator) { + print < + $Lang::tr{'modem network operator'} + $network_operator + +END + } + + my $network_mode = $modem->get_network_mode(); + if ($network_mode) { + print < + $Lang::tr{'modem network mode'} + $network_mode + +END + } + + my $signal_quality = $modem->get_signal_quality(); + if ($signal_quality) { + print < + $Lang::tr{'modem network signal quality'} + $signal_quality dBm + +END + } + + my $bit_error_rate = $modem->get_bit_error_rate(); + if ($bit_error_rate) { + print < + $Lang::tr{'modem network bit error rate'} + $bit_error_rate + +END + } + print < + +END + + &Header::closebox(); +} else { + &Header::openbox("100%", "center", $Lang::tr{'modem no connection'}); + print "

$Lang::tr{'modem no connection message'}

"; + &Header::closebox(); +} + +&Header::closebigbox(); +&Header::closepage(); diff --git a/html/cgi-bin/pppsetup.cgi b/html/cgi-bin/pppsetup.cgi index edec82696..563d0eb58 100644 --- a/html/cgi-bin/pppsetup.cgi +++ b/html/cgi-bin/pppsetup.cgi @@ -73,6 +73,9 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'}) if ($pppsettings{'TYPE'} =~ /^(modem|serial|isdn)$/ && $pppsettings{'COMPORT'} !~ /^(ttyS0|ttyS1|ttyS2|ttyS3|ttyS4|ttyACM0|ttyACM1|ttyACM2|ttyACM3|ttyUSB0|ttyUSB1|ttyUSB2|ttyUSB3|rfcomm0|rfcomm1|isdn1|isdn2)$/) { $errormessage = $Lang::tr{'invalid input'}; goto ERROR; } + if ($pppsettings{'TYPE'} =~ /^(modem|serial|isdn)$/ && $pppsettings{'MONPORT'} !~ /^(ttyUSB0|ttyUSB1|ttyUSB2|ttyUSB3)$/) { + $errormessage = $Lang::tr{'invalid input'}; + goto ERROR; } if ($pppsettings{'TYPE'} =~ /^(modem|serial)$/ && $pppsettings{'DTERATE'} !~ /^(9600|19200|38400|57600|115200|230400|460800|921600)$/) { $errormessage = $Lang::tr{'invalid input'}; goto ERROR; } @@ -335,6 +338,13 @@ $selected{'COMPORT'}{'rfcomm0'} = ''; $selected{'COMPORT'}{'rfcomm1'} = ''; $selected{'COMPORT'}{$pppsettings{'COMPORT'}} = "selected='selected'"; +$selected{'MONPORT'}{''} = ''; +$selected{'MONPORT'}{'ttyUSB0'} = ''; +$selected{'MONPORT'}{'ttyUSB1'} = ''; +$selected{'MONPORT'}{'ttyUSB2'} = ''; +$selected{'MONPORT'}{'ttyUSB3'} = ''; +$selected{'MONPORT'}{$pppsettings{'MONPORT'}} = "selected='selected'"; + $selected{'DTERATE'}{'9600'} = ''; $selected{'DTERATE'}{'19200'} = ''; $selected{'DTERATE'}{'38400'} = ''; @@ -583,6 +593,24 @@ END ; } print " "} + + if ($pppsettings{'TYPE'} =~ /^(modem|serial)$/) { + print < + $Lang::tr{'monitor interface'}: + + + + +END + } + if ($pppsettings{'TYPE'} =~ /^(modem|serial)$/ ) { print < @@ -926,6 +954,7 @@ sub initprofile { $pppsettings{'PROFILENAME'} = $Lang::tr{'unnamed'}; $pppsettings{'COMPORT'} = 'ttyS0'; + $pppsettings{'MONPORT'} = ''; $pppsettings{'DTERATE'} = 115200; $pppsettings{'SPEAKER'} = 'off'; $pppsettings{'RECONNECTION'} = 'persistent'; diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 74bd6e887..c24e181fb 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -467,6 +467,7 @@ 'cant change certificates' => 'Kann Zertifikate nicht ändern.', 'cant enable xtaccess' => 'Die zugehörige Port-Weiterleitungsregel ist deaktiviert, daher können Sie den externen Zugang für diese Regel nicht aktivieren.', 'cant start openssl' => 'Kann OpenSSL nicht starten', +'capabilities' => 'Unterstützte Features', 'caps all' => 'ALLE', 'capsclosed' => 'GETRENNT', 'capsinactive' => 'INAKTIV', @@ -1194,8 +1195,10 @@ 'ike integrity' => 'IKE Integrität:', 'ike lifetime' => 'IKE Lebensdauer:', 'ike lifetime should be between 1 and 8 hours' => 'IKE Lebensdauer sollte zwischen 1 und 8 Stunden betragen.', +'imei' => 'IMEI', 'import' => 'Import', 'importkey' => 'PSK importieren', +'imsi' => 'IMSI', 'in' => 'Ein', 'inactive' => 'inaktiv', 'include logfiles' => 'mit Logdateien', @@ -1447,15 +1450,28 @@ 'missing dat' => 'Verschlüsseltes Archiv wurde nicht gefunden', 'missing gz' => 'Nichtverschlüsseltes Archiv wurde nicht gefunden', 'mode' => 'Modus', +'model' => 'Modell', 'modem' => 'Modem', 'modem configuration' => 'Modem-Konfiguration', +'modem hardware details' => 'Modem-Hardware', +'modem information' => 'Modem-Informationen', +'modem network bit error rate' => 'Bit-Fehlerrate', +'modem network information' => 'Netzwerkinformationen', +'modem network mode' => 'Netzwerkmodus', +'modem network operator' => 'Netzbetreiber', +'modem network registration' => 'Netzregistrierung', +'modem network signal quality' => 'Signalqualität', +'modem no connection' => 'Keine Verbindung', +'modem no connection message' => 'Es konnte keine Verbindung zum Modem aufgebaut werden.', 'modem on com1' => 'Modem an COM1', 'modem on com2' => 'Modem an COM2', 'modem on com3' => 'Modem an COM3', 'modem on com4' => 'Modem an COM4', 'modem on com5' => 'Modem an COM5', 'modem settings have errors' => 'Modemeinstellungen fehlerhaft', +'modem sim information' => 'SIM-Informationen', 'modem speaker on' => 'Modemlautsprecher an:', +'modem status' => 'Modem-Status', 'modify' => 'Ändern', 'modulation' => 'Modulation', 'monday' => 'Montag', @@ -1919,6 +1935,7 @@ 'snort hits' => 'Gesamtanzahl der aktivierten Intrusion-Regeln für', 'snort working' => 'Snort führt gerade eine Aufgabe aus... Bitte warten Sie, bis diese erfolgreich beendet wurde.', 'socket options' => 'Socket Options', +'software version' => 'Software-Version', 'sort ascending' => 'Sortiere aufsteigend', 'sort descending' => 'Sortiere absteigend', 'sound' => 'Klang', @@ -2459,6 +2476,7 @@ 'valid root certificate already exists' => 'Ein gültiges Root-Zertifikat existiert bereits.', 'valid till' => 'Gültig bis', 'vci number' => 'VCI-Nummer:', +'vendor' => 'Hersteller', 'view log' => 'Log anzeigen', 'virtual address' => 'Virtuelle Addresse', 'virtual private networking' => 'Virtuelles Privates Netzwerk', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index f8cdf7630..1935ca232 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -486,6 +486,7 @@ 'cant change certificates' => 'Can\'t change certificates.', 'cant enable xtaccess' => 'The associated port forwarding rule is disabled, therefore you cannot enable external access for this rule.', 'cant start openssl' => 'Can\'t start OpenSSL', +'capabilities' => 'Capabilities', 'caps all' => 'ALL', 'capsclosed' => 'DISCONNECTED', 'capsinactive' => 'INACTIVE', @@ -1222,8 +1223,10 @@ 'ike integrity' => 'IKE Integrity:', 'ike lifetime' => 'IKE Lifetime:', 'ike lifetime should be between 1 and 8 hours' => 'IKE lifetime should be between 1 and 8 hours.', +'imei' => 'IMEI', 'import' => 'Import', 'importkey' => 'Import PSK', +'imsi' => 'IMSI', 'in' => 'In', 'inactive' => 'inactive', 'include logfiles' => 'Include logfiles', @@ -1476,15 +1479,28 @@ 'missing dat' => 'Encrypted archive not found', 'missing gz' => 'Unencrypted archive not found', 'mode' => 'Mode', +'model' => 'Model', 'modem' => 'Modem', 'modem configuration' => 'Modem configuration', +'modem hardware details' => 'Modem Hardware', +'modem information' => 'Modem Information', +'modem network bit error rate' => 'Bit Error Rate', +'modem network information' => 'Network Information', +'modem network mode' => 'Network Mode', +'modem network operator' => 'Network Operator', +'modem network registration' => 'Network Registration', +'modem network signal quality' => 'Signal Quality', +'modem no connection' => 'No Connection', +'modem no connection message' => 'No connection to the modem could be established.', 'modem on com1' => 'Modem on COM1', 'modem on com2' => 'Modem on COM2', 'modem on com3' => 'Modem on COM3', 'modem on com4' => 'Modem on COM4', 'modem on com5' => 'Modem on COM5', 'modem settings have errors' => 'Modem settings have errors', +'modem sim information' => 'SIM Information', 'modem speaker on' => 'Modem speaker on:', +'modem status' => 'Modem Status', 'modify' => 'Modify', 'modulation' => 'Modulation', 'monday' => 'Monday', @@ -1954,6 +1970,7 @@ 'snort hits' => 'Total of number of Intrusion rules activated for', 'snort working' => 'Snort is working ... Please wait until all operations have completed successfully.', 'socket options' => 'Socket options', +'software version' => 'Software Version', 'sort ascending' => 'Sort ascending', 'sort descending' => 'Sort descending', 'sound' => 'Sound', @@ -2498,6 +2515,7 @@ 'valid root certificate already exists' => 'A valid root certificate already exists.', 'valid till' => 'Valid till', 'vci number' => 'VCI number:', +'vendor' => 'Vendor', 'view log' => 'view log', 'virtual address' => 'Virtual Address', 'virtual private networking' => 'Virtual Private Networking', diff --git a/lfs/configroot b/lfs/configroot index 3232d38ec..fcb08b0d4 100644 --- a/lfs/configroot +++ b/lfs/configroot @@ -80,6 +80,7 @@ $(TARGET) : cp $(DIR_SRC)/config/cfgroot/lang.pl $(CONFIG_ROOT)/ cp $(DIR_SRC)/config/cfgroot/countries.pl $(CONFIG_ROOT)/ cp $(DIR_SRC)/config/cfgroot/graphs.pl $(CONFIG_ROOT)/ + cp $(DIR_SRC)/config/cfgroot/modem-lib.pl $(CONFIG_ROOT)/ cp $(DIR_SRC)/config/cfgroot/advoptions-list $(CONFIG_ROOT)/dhcp/advoptions-list cp $(DIR_SRC)/config/cfgroot/connscheduler-lib.pl $(CONFIG_ROOT)/connscheduler/lib.pl cp $(DIR_SRC)/config/cfgroot/connscheduler.conf $(CONFIG_ROOT)/connscheduler diff --git a/lfs/perl-Device-Modem b/lfs/perl-Device-Modem new file mode 100644 index 000000000..f0609b928 --- /dev/null +++ b/lfs/perl-Device-Modem @@ -0,0 +1,77 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2014 IPFire Team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.56 + +THISAPP = Device-Modem-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = a0ec45c3e313bea27ccb476d3b725955 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/lfs/perl-Device-SerialPort b/lfs/perl-Device-SerialPort new file mode 100644 index 000000000..3eebc07d7 --- /dev/null +++ b/lfs/perl-Device-SerialPort @@ -0,0 +1,77 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2014 IPFire Team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.000002 + +THISAPP = Device-SerialPort-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = f53db3733679adc5d05d06fa530444b6 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 23b63ae85..eb9cd315c 100755 --- a/make.sh +++ b/make.sh @@ -514,6 +514,8 @@ buildipfire() { ipfiremake perl-GD ipfiremake GD-Graph ipfiremake GD-TextUtil + ipfiremake perl-Device-SerialPort + ipfiremake perl-Device-Modem ipfiremake gnupg ipfiremake hdparm ipfiremake sdparm -- 2.39.2