From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4d7qVM2HDjz332y for ; Sat, 15 Nov 2025 10:09:15 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4d7qVH6YWvz2xXK for ; Sat, 15 Nov 2025 10:09:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4d7qVH0Pqqz1rb; Sat, 15 Nov 2025 10:09:10 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1763201351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/jJt+G7amn7ohYdmFAFtiPqNrm5Yaq3/ZURmU0cTpTA=; b=L+JkzPt6OLDUqJgV2KHBjWWsiTzoT5l7wNhSZqibFawj09gdVpyQsa8Og2H4JNTNxUu4nB jKl5a6f5HXIC4yDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1763201351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/jJt+G7amn7ohYdmFAFtiPqNrm5Yaq3/ZURmU0cTpTA=; b=cXgZl7P/RCrWavrSt6dMS5nlAehCtQrNLQm8fP4z2i+pwy5iCXBKse5X8+IlsKlzPxzhGY WsPpKa+TNirAQIoIbuYGxnK9uWS/kBKjko2oDzmJlxxPQoBK2VK5T4At8DsJ6GFvG+a4qg 0IY0u4V/mUKFleujAwILjvppgb3d28MVzLx1LSOpscGaTeXcVGyHwZ856diaRgzpWfFNZq H90hEXYFltsEgseJITQ/8/5tXCud6gop2Q+5ocKvwkQ+eYpNXC0MGwFTvKJeMdqhbVdHHQ Bx37OHqQPGL5Ynst9PaIElnI8JwzbRpV1BPURPRJkOufFXeO3CfjJ0wWM3D1gw== From: Stefan Schantl To: development@lists.ipfire.org Cc: Stefan Schantl Subject: [PATCH 2/3] lldp.cgi: Call binary for peers and do json stuff only if the service is enabled Date: Sat, 15 Nov 2025 11:07:57 +0100 Message-ID: <20251115100758.7039-2-stefan.schantl@ipfire.org> In-Reply-To: <20251115100758.7039-1-stefan.schantl@ipfire.org> References: <20251115100758.7039-1-stefan.schantl@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Schantl --- html/cgi-bin/lldp.cgi | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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 -- 2.47.3