From patchwork Mon Oct 3 15:39:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Roevens X-Patchwork-Id: 6036 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Mh5lB5YcYz3wcJ for ; Mon, 3 Oct 2022 16:24:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Mh5lB1Zcnz1Cb; Mon, 3 Oct 2022 16:24:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Mh5lB0hcpz2y1h; Mon, 3 Oct 2022 16:24:38 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Mh5l86Stgz2xJQ for ; Mon, 3 Oct 2022 16:24:36 +0000 (UTC) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Mh5l82NgGzWy for ; Mon, 3 Oct 2022 16:24:36 +0000 (UTC) Received: by disroot.org (Postfix, from userid 107) id F3F264C365; Mon, 3 Oct 2022 18:14:41 +0200 (CEST) Received: from chojin.sicho.home (amaterasu.sicho.home [192.168.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (no client certificate requested) (Authenticated sender) by hachiman (MailScanner Milter) with SMTP id D3D3571E95; Mon, 3 Oct 2022 17:39:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1664813681; bh=KgPGKDLiJ+GgzVR4xdybw2IHfe7UnLCZ9RcHmV2gLdY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H4508WCNwM8lGhaqP0LDLgXwELsJgsbYUj3840hoQfyQQ5JOJrtz7CeX276Iva/w0 I8I8QIsYHmlqkKt4t7LWL9t91TVWynEc/X0HcC08HyA67mg/OCkCDS3XT4wl7uC2j6 QFWG1zVHeBauWiPhwNG5oTsrpMt6sO0Z6zx9Y5PGH2y+ATGtktuPpWLgDr8GE7COGC cMuQY9nm5wJraFJM6ru/NRn3HQR822uoBwr4H/n7rKMIlXHfWKd9La1zYUiBVzHhP+ 1+kEQ/kw5rBodbROsVQqln7/65RmVf+WeFBtiJy1pJugRpUFVxbol2+D0tOj7ycdEn iJZW9lHceBu8g== From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH 3/3] services.cgi: add link to addon config if ui exists for it Date: Mon, 3 Oct 2022 17:39:05 +0200 Message-Id: <20221003153905.14824-4-robin.roevens@disroot.org> In-Reply-To: <20221003153905.14824-1-robin.roevens@disroot.org> References: <20221003153905.14824-1-robin.roevens@disroot.org> Mime-Version: 1.0 X-sicho-MailScanner-ID: D3D3571E95.A8A80 X-sicho-MailScanner: Found to be clean X-sicho-MailScanner-From: robin.roevens@disroot.org X-sicho-MailScanner-Watermark: 1665416366.06491@g+r9uUZU7dq8cbrmYHB9jw X-Spam-Status: No ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1664814276; a=rsa-sha256; cv=none; b=jLjvbN0o7Ww1GGC5AnNZGNyh8Hzug/PqtltMg7cgQMXReaaPnprrNg8xoSUwIvLJKzb5XZ V1HlzorRDVgOWTvsbwh1v3RXeJ7Iljo+eglhE/yoiVH671tcwjdwBTjoHOV8HtDQVr5v8o pkxlM0G/BAzcgQK13Nz+bZgTk3cfx/Ee9rFEAohIOS4OU0pzNXiCbrQ4zT/X2oPpBG7dj1 cuYEWJmQvVQGhMYTYwl2SHxGXPgRTVuv6REqK3u0FohQkMAO0nwdiHiZwH1B9DLz+l+yGu EUV2UtDpdIGULbcunLw/hLEXzZ8ADdpsxRUwrIFcD9cndT+wgo36kf0CbsAzKw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=H4508WCN; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org; dmarc=pass (policy=quarantine) header.from=disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1664814276; 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:dkim-signature; bh=0qrxh4lf8P/LmAJoaf9T5BF6nOd9Mna2nF4VrpdJryA=; b=LlgQedeox6XfBNVjKrRYwCOrYALtynJGN0/wblg5BBBxoDKd4hk0YhIAfakzmMKyfxvuis reSEYjq+i2JYBK2u1su5eb3sFxdEFwyCwLMdPtlFQqKl7pY/kpTlCwiMtnztcW5DNqh+oM 6hDpSEy7LsNVg6tAMPzgOSO1BTJ7hM2mwSjHFAMRPDvT91mwFpmQnxpHvjVuw+kOHwLDI1 tdJl6kihnWx+KFQWa/fCRxxbVJ3ke7QVdhdSEXGttpr247L+EB1HawDiDNGEOc1eyznvcw GA/hFrxihwN+eRZhbaUxniNVREouCokajSS1Stp40Ht7c6gOSPvABTyLfXMmJQ== Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=H4508WCN; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org; dmarc=pass (policy=quarantine) header.from=disroot.org X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-9.03 / 11.00]; REPLY(-4.00)[]; BAYES_HAM(-2.98)[99.90%]; IP_REPUTATION_HAM(-1.07)[asn: 50673(-0.30), country: NL(-0.01), ip: 178.21.23.139(-0.76)]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; DKIM_REPUTATION(-0.77)[-0.76741109695771]; SPF_REPUTATION_HAM(-0.67)[-0.66694155491188]; R_MISSING_CHARSET(0.50)[]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[disroot.org,quarantine]; R_DKIM_ALLOW(0.26)[disroot.org:s=mail]; R_SPF_ALLOW(-0.20)[+a:c]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[disroot.org:+]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 4Mh5l82NgGzWy X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" * If a cgi file exists with the same name as an addon, the displayed service will be a link to that cgi file. Signed-off-by: Robin Roevens Reviewed-by: Bernhard Bitsch --- html/cgi-bin/services.cgi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index 498d7fd8e..d988b29a5 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -185,6 +185,10 @@ END # Add addon name to displayname of service if servicename differs from addon my $displayname = ($pak ne $service) ? "$service ($pak)" : $service; + if ( -e "/srv/web/ipfire/cgi-bin/$pak.cgi" ) { + $displayname = ($pak ne $service) ? "$service ($pak)" : "$service"; + } + print "$displayname "; my $status = isautorun($pak,$service,$col);