From: Stefan Schantl Date: Sat, 15 Nov 2025 10:07:57 +0000 (+0100) Subject: lldp.cgi: Call binary for peers and do json stuff only if the service is enabled X-Git-Tag: v2.29-core199~17^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9953d4c1254615f6d80ac7497dabb2df8500ea5a;p=ipfire-2.x.git lldp.cgi: Call binary for peers and do json stuff only if the service is enabled Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/lldp.cgi b/html/cgi-bin/lldp.cgi index 9e30faa92..194f4ec82 100644 --- a/html/cgi-bin/lldp.cgi +++ b/html/cgi-bin/lldp.cgi @@ -116,21 +116,21 @@ MAIN: END &Header::closebox(); - # Load data about all peers - my @output = &General::system_output("lldpctl", "-f", "json0"); + # Show a list with all peers if the service is enabled + if ($settings{"ENABLED"} eq "on") { + # Load data about all peers + my @output = &General::system_output("lldpctl", "-f", "json0"); - my $json; + my $json; - # Parse the JSON output - eval { - $json = decode_json join("\n", @output); - 1; - } or do { - $json = undef; - }; + # Parse the JSON output + eval { + $json = decode_json join("\n", @output); + 1; + } or do { + $json = undef; + }; - # Show a list with all peers if the service is enabled - if ($settings{"ENABLED"} eq "on") { &Header::opensection($Lang::tr{'lldp neighbors'}); # Fetch the interface object