log.dat: Fixes bug#12950 - adding apcupsd to system logs list

Message ID 20230221135517.6286-1-adolf.belka@ipfire.org
State Accepted
Commit 284ebca0577fe41ee914e70c72865794be705c01
Headers
Series log.dat: Fixes bug#12950 - adding apcupsd to system logs list |

Commit Message

Adolf Belka Feb. 21, 2023, 1:55 p.m. UTC
  - Patch tested out on my production system that has apcupsd running on it. APCUPS was
   in the list of options in the system logs and entries from apcupsd were extracted
   correctly in the wui.

Fixes: Bug#12950
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 html/cgi-bin/logs.cgi/log.dat | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Michael Tremer Feb. 22, 2023, 9:52 a.m. UTC | #1
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

> On 21 Feb 2023, at 13:55, Adolf Belka <adolf.belka@ipfire.org> wrote:
> 
> - Patch tested out on my production system that has apcupsd running on it. APCUPS was
>   in the list of options in the system logs and entries from apcupsd were extracted
>   correctly in the wui.
> 
> Fixes: Bug#12950
> Tested-by: Adolf Belka <adolf.belka@ipfire.org>
> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
> ---
> html/cgi-bin/logs.cgi/log.dat | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat
> index 5fb1fcd5d..bf71b3c9f 100644
> --- a/html/cgi-bin/logs.cgi/log.dat
> +++ b/html/cgi-bin/logs.cgi/log.dat
> @@ -49,6 +49,7 @@ $cgiparams{'ACTION'} = '';
> $cgiparams{'SECTION'} = 'ipfire';
> 
> my %sections = (
> +        'apcupsd' => '(apcupsd\[.*?\]: )',
>         'auth' => '(\w+\(pam_unix\)\[.*\]: )',
>         'wio' => '(wio:|wio\[.*\])',
>         'captive' => '(Captive:)',
> @@ -81,6 +82,7 @@ my %sections = (
> 
> # Translations for the %sections array.
> my %trsections = (
> +        'apcupsd' => 'APCUPS',
>         'auth' => "$Lang::tr{'loginlogout'}",
>         'wio' => 'Who Is Online?',
>         'captive' => $Lang::tr{'Captive'},
> -- 
> 2.39.2
>
  

Patch

diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat
index 5fb1fcd5d..bf71b3c9f 100644
--- a/html/cgi-bin/logs.cgi/log.dat
+++ b/html/cgi-bin/logs.cgi/log.dat
@@ -49,6 +49,7 @@  $cgiparams{'ACTION'} = '';
 $cgiparams{'SECTION'} = 'ipfire';
 
 my %sections = (
+        'apcupsd' => '(apcupsd\[.*?\]: )',
         'auth' => '(\w+\(pam_unix\)\[.*\]: )',
         'wio' => '(wio:|wio\[.*\])',
         'captive' => '(Captive:)',
@@ -81,6 +82,7 @@  my %sections = (
 
 # Translations for the %sections array.
 my %trsections = (
+        'apcupsd' => 'APCUPS',
         'auth' => "$Lang::tr{'loginlogout'}",
         'wio' => 'Who Is Online?',
         'captive' => $Lang::tr{'Captive'},