return $rc;
}
+sub read_pids($) {
+ my $pidfile = shift;
+
+ # Open the PID file
+ open(PIDFILE, "<${pidfile}");
+
+ # Store all PIDs here
+ my @pids = ();
+
+ # Read all PIDs
+ while (<PIDFILE>) {
+ chomp $_;
+
+ if (-d "/proc/$_") {
+ push(@pids, $_);
+ }
+ }
+
+ # Close the PID file
+ close(PIDFILE);
+
+ return @pids;
+}
+
+sub find_pids($) {
+ my $process = shift;
+
+ # Store all PIDs here
+ my @pids = ();
+
+ foreach my $status (</proc/*/status>) {
+ # Open the status file
+ open(STATUS, "<${status}");
+
+ # Read the status file
+ while (<STATUS>) {
+ # If the name does not match, we break the loop immediately
+ if ($_ =~ m/^Name:\s+(.*)$/) {
+ last if ($process ne $1);
+
+ # Push the PID onto the list
+ } elsif ($_ =~ m/^Pid:\s+(\d+)$/) {
+ push(@pids, $1);
+
+ # Once we got here, we are done
+ last;
+ }
+ }
+
+ # Close the status file
+ close(STATUS);
+ }
+
+ return @pids;
+}
+
+sub get_memory_consumption() {
+ my $memory = 0;
+
+ foreach my $pid (@_) {
+ # Open the status file or skip on error
+ open(STATUS, "/proc/${pid}/status") or next;
+
+ while (<STATUS>) {
+ if ($_ =~ m/^VmRSS:\s+(\d+) kB/) {
+ $memory += $1 * 1024;
+ last;
+ }
+ }
+
+ close(STATUS);
+ }
+
+ return $memory;
+}
+
# Function to remove duplicates from an array
sub uniq { my %seen; grep !$seen{$_}++, @_ }
close($file);
}
+sub ServiceStatus() {
+ my $services = shift;
+ my %services = %{ $services };
+
+ # Write the table header
+ print <<EOF;
+ <table class="tbl">
+ <!-- <thead>
+ <tr>
+ <th>
+ $Lang::tr{'service'}
+ </th>
+
+ <th>
+ $Lang::tr{'status'}
+ </th>
+
+ <th>
+ $Lang::tr{'memory'}
+ </th>
+ </tr>
+ </thead> -->
+
+ <tbody>
+EOF
+
+ foreach my $service (sort keys %services) {
+ my %config = %{ $services{$service} };
+
+ my $pidfile = $config{"pidfile"};
+ my $process = $config{"process"};
+
+ # Collect all pids
+ my @pids = ();
+
+ # Read the PID file or go search...
+ if (defined $pidfile) {
+ @pids = &General::read_pids("${pidfile}");
+ } else {
+ @pids = &General::find_pids("${process}");
+ }
+
+ # Get memory consumption
+ my $mem = &General::get_memory_consumption(@pids);
+
+ print <<EOF;
+ <tr>
+ <th scope="row">
+ $service
+ </th>
+EOF
+
+ # Running?
+ if (scalar @pids) {
+ # Format memory
+ $mem = &General::formatBytes($mem);
+
+ print <<EOF;
+ <td class="status is-running">
+ $Lang::tr{'running'}
+ </td>
+
+ <td class="text-right">
+ ${mem}
+ </td>
+EOF
+
+ # Not Running
+ } else {
+ print <<EOF;
+ <td class="status is-stopped" colspan="2">
+ $Lang::tr{'stopped'}
+ </td>
+EOF
+ }
+
+ print <<EOF;
+ </tr>
+EOF
+
+ }
+
+ print <<EOF;
+ </tbody>
+ </table>
+EOF
+}
+
1; # End of package "Header"
WARNING: translation string unused: interfaces
WARNING: translation string unused: intrusion detection system log viewer
WARNING: translation string unused: intrusion detection system2
-WARNING: translation string unused: intrusion prevention system
WARNING: translation string unused: invalid cache size
WARNING: translation string unused: invalid date entered
WARNING: translation string unused: invalid downlink speed
WARNING: untranslated string: netbios nameserver daemon = NetBIOS Nameserver Daemon
WARNING: untranslated string: no entries = No entries at the moment.
WARNING: untranslated string: optional = Optional
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: pakfire invalid tree = Invalid repository selected
WARNING: untranslated string: reg_file_data_sampling = Register File Data Sampling (RFDS)
WARNING: untranslated string: regenerate host certificate = Renew Host Certificate
WARNING: untranslated string: intrusion detection = Intrusion Prevention
WARNING: untranslated string: intrusion detection system = Intrusion Prevention System
WARNING: untranslated string: intrusion detection system rules = Ruleset
+WARNING: untranslated string: intrusion prevention system = Intrusion Prevention System
WARNING: untranslated string: invalid broadcast ip = Invalid broadcast IP
WARNING: untranslated string: invalid characters found in pre-shared key = Invalid characters found in pre-shared key.
WARNING: untranslated string: invalid default lease time = Invalid default lease time.
WARNING: untranslated string: ovpn on orange = OpenVPN on ORANGE:
WARNING: untranslated string: ovpn on red = OpenVPN on RED:
WARNING: untranslated string: ovpn port in root range = A port number of 1024 or higher is required.
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: ovpn routes push = Routes (one per line) e.g. 192.168.10.0/255.255.255.0 192.168.20.0/24
WARNING: untranslated string: ovpn routes push options = Route push options
WARNING: untranslated string: ovpn rw connection log = OpenVPN Roadwarrior Connections Log
WARNING: translation string unused: interfaces
WARNING: translation string unused: intrusion detection system log viewer
WARNING: translation string unused: intrusion detection system2
-WARNING: translation string unused: intrusion prevention system
WARNING: translation string unused: invalid cache size
WARNING: translation string unused: invalid date entered
WARNING: translation string unused: invalid downlink speed
WARNING: untranslated string: no data = unknown string
WARNING: untranslated string: openvpn cert expires soon = Expires Soon
WARNING: untranslated string: openvpn cert has expired = Expired
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: pakfire ago = ago.
WARNING: untranslated string: processors = Processors
WARNING: untranslated string: reg_file_data_sampling = Register File Data Sampling (RFDS)
WARNING: translation string unused: interfaces
WARNING: translation string unused: intrusion detection system log viewer
WARNING: translation string unused: intrusion detection system2
-WARNING: translation string unused: intrusion prevention system
WARNING: translation string unused: invalid cache size
WARNING: translation string unused: invalid date entered
WARNING: translation string unused: invalid downlink speed
WARNING: untranslated string: hostile networks total = Total Hostile Networks
WARNING: untranslated string: ids provider eol = (EOL)
WARNING: untranslated string: load average = Load Average
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: pakfire ago = ago.
WARNING: untranslated string: processors = Processors
WARNING: untranslated string: reg_file_data_sampling = Register File Data Sampling (RFDS)
WARNING: untranslated string: info messages = unknown string
WARNING: untranslated string: inodes = Index-Nodes
WARNING: untranslated string: interface mode = Interface
+WARNING: untranslated string: intrusion prevention system = Intrusion Prevention System
WARNING: untranslated string: invalid input for inactivity timeout = Invalid input for Inactivity Timeout
WARNING: untranslated string: invalid input for interface address = Invalid input for interface address
WARNING: untranslated string: invalid input for interface mode = Invalid input for interface mode
WARNING: untranslated string: ovpn add conf = Additional configuration
WARNING: untranslated string: ovpn connection name = Connection Name
WARNING: untranslated string: ovpn error md5 = You host certificate uses MD5 for the signature which is not accepted anymore. <br>Please update to the latest IPFire version and generate a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: ovpn rw connection log = OpenVPN Roadwarrior Connections Log
WARNING: untranslated string: ovpn tls auth = TLS Channel Protection:
WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
WARNING: untranslated string: info messages = unknown string
WARNING: untranslated string: inodes = Index-Nodes
WARNING: untranslated string: interface mode = Interface
+WARNING: untranslated string: intrusion prevention system = Intrusion Prevention System
WARNING: untranslated string: invalid input for inactivity timeout = Invalid input for Inactivity Timeout
WARNING: untranslated string: invalid input for interface address = Invalid input for interface address
WARNING: untranslated string: invalid input for interface mode = Invalid input for interface mode
WARNING: untranslated string: ovpn crypt options = Cryptographic options
WARNING: untranslated string: ovpn error md5 = You host certificate uses MD5 for the signature which is not accepted anymore. <br>Please update to the latest IPFire version and generate a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
WARNING: untranslated string: ovpn ha = Hash algorithm
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: ovpn rw connection log = OpenVPN Roadwarrior Connections Log
WARNING: untranslated string: ovpn tls auth = TLS Channel Protection:
WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
WARNING: untranslated string: inodes = Index-Nodes
WARNING: untranslated string: integrity = Integrity:
WARNING: untranslated string: interface mode = Interface
+WARNING: untranslated string: intrusion prevention system = Intrusion Prevention System
WARNING: untranslated string: invalid input for dpd delay = Invalid input for DPD delay
WARNING: untranslated string: invalid input for dpd timeout = Invalid input for DPD timeout
WARNING: untranslated string: invalid input for inactivity timeout = Invalid input for Inactivity Timeout
WARNING: untranslated string: ovpn mgmt in root range = A port number of 1024 or higher is required.
WARNING: untranslated string: ovpn no connections = No active OpenVPN connections
WARNING: untranslated string: ovpn port in root range = A port number of 1024 or higher is required.
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: ovpn routes push = Routes (one per line) e.g. 192.168.10.0/255.255.255.0 192.168.20.0/24
WARNING: untranslated string: ovpn routes push options = Route push options
WARNING: untranslated string: ovpn rw connection log = OpenVPN Roadwarrior Connections Log
WARNING: untranslated string: inodes = Index-Nodes
WARNING: untranslated string: integrity = Integrity:
WARNING: untranslated string: interface mode = Interface
+WARNING: untranslated string: intrusion prevention system = Intrusion Prevention System
WARNING: untranslated string: invalid input for dpd delay = Invalid input for DPD delay
WARNING: untranslated string: invalid input for dpd timeout = Invalid input for DPD timeout
WARNING: untranslated string: invalid input for inactivity timeout = Invalid input for Inactivity Timeout
WARNING: untranslated string: ovpn mgmt in root range = A port number of 1024 or higher is required.
WARNING: untranslated string: ovpn no connections = No active OpenVPN connections
WARNING: untranslated string: ovpn port in root range = A port number of 1024 or higher is required.
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: ovpn rw connection log = OpenVPN Roadwarrior Connections Log
WARNING: untranslated string: ovpn tls auth = TLS Channel Protection:
WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
WARNING: untranslated string: info messages = unknown string
WARNING: untranslated string: inodes = Index-Nodes
WARNING: untranslated string: interface mode = Interface
+WARNING: untranslated string: intrusion prevention system = Intrusion Prevention System
WARNING: untranslated string: invalid input for interface address = Invalid input for interface address
WARNING: untranslated string: invalid input for interface mode = Invalid input for interface mode
WARNING: untranslated string: invalid input for interface mtu = Invalid input to interface MTU
WARNING: untranslated string: otp qrcode = OTP QRCode
WARNING: untranslated string: ovpn connection name = Connection Name
WARNING: untranslated string: ovpn error md5 = You host certificate uses MD5 for the signature which is not accepted anymore. <br>Please update to the latest IPFire version and generate a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
+WARNING: untranslated string: ovpn roadwarrior server = OpenVPN Roadwarrior Server
WARNING: untranslated string: ovpn rw connection log = OpenVPN Roadwarrior Connections Log
WARNING: untranslated string: ovpn tls auth = TLS Channel Protection:
WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
< notes
< okay
< optional
+< ovpn roadwarrior server
< quick control
< random number generator daemon
< regenerate host certificate
< log drop hostile out
< openvpn cert expires soon
< openvpn cert has expired
+< ovpn roadwarrior server
< processors
< regenerate host certificate
< reg_file_data_sampling
< ids provider eol
< ids unsupported provider
< load average
+< ovpn roadwarrior server
< processors
< reg_file_data_sampling
< system time
< ovpn add conf
< ovpn connection name
< ovpn error md5
+< ovpn roadwarrior server
< ovpn rw connection log
< ovpn tls auth
< ovpn warning rfc3280
< ovpn generating the root and host certificates
< ovpn ha
< ovpn reneg sec
+< ovpn roadwarrior server
< ovpn rw connection log
< ovpn tls auth
< ovpn warning rfc3280
< ovpn no connections
< ovpn port in root range
< ovpn reneg sec
+< ovpn roadwarrior server
< ovpn routes push
< ovpn routes push options
< ovpn rw connection log
< ovpn no connections
< ovpn port in root range
< ovpn reneg sec
+< ovpn roadwarrior server
< ovpn rw connection log
< ovpn tls auth
< ovpn warning rfc3280
< otp qrcode
< ovpn connection name
< ovpn error md5
+< ovpn roadwarrior server
< ovpn rw connection log
< ovpn tls auth
< ovpn warning rfc3280
$activeonrun = "disabled='disabled'";
}
&Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'});
+
+ # Show the service status
+ &Header::ServiceStatus({
+ $Lang::tr{'ovpn roadwarrior server'} => {
+ "process" => "openvpn",
+ "pidfile" => "/var/run/openvpn.pid",
+ }
+ });
+
print <<END;
<table width='100%' border='0'>
<form method='post'>
float: right !important;
}
+/*
+ Text Alignment
+*/
+
+.text-left {
+ text-align: left;
+}
+
+.text-center {
+ text-align: center;
+}
+
+.text-right {
+ text-align: right;
+}
+
/* Header */
#header {
border-spacing: 0;
}
+.tbl {
+ width: 100%;
+}
+
.tbl th {
color: #ffffff;
border-top: 1px solid #363636;
'ovpn on red' => 'OpenVPN on RED:',
'ovpn port in root range' => 'A port number of 1024 or higher is required.',
'ovpn reneg sec' => 'Session key lifetime:',
+'ovpn roadwarrior server' => 'OpenVPN Roadwarrior Server',
'ovpn routes push' => 'Routes (one per line) e.g. 192.168.10.0/255.255.255.0 192.168.20.0/24',
'ovpn routes push options' => 'Route push options',
'ovpn rw connection log' => 'OpenVPN Roadwarrior Connections Log',