Message ID | 20230801154839.2373-5-stefan.schantl@ipfire.org |
---|---|
State | Staged |
Commit | 0aa77c2fd50daccb6dd4d71f05a9fd3a187b993e |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> 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) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RFffs3Xfjz3wmm for <patchwork@web04.haj.ipfire.org>; Tue, 1 Aug 2023 15:49:09 +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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RFffm4XVnz1gn; Tue, 1 Aug 2023 15:49:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RFffm454yz2yV9; Tue, 1 Aug 2023 15:49:04 +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 4RFffl6t1Mz2xgB for <development@lists.ipfire.org>; Tue, 1 Aug 2023 15:49:03 +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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RFffj6MsfzW2; Tue, 1 Aug 2023 15:49:01 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1690904942; 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=3l/+ixKOtQP7WwaWMjsaOmjumffB7vALDDS/TZBQp1s=; b=WX8rD+f79LQ6LdcIFbjDEfRDnY1zwZWhpFl5qCu3bZ2IDvh9D6uZKcOxG/YLXCZh66lB5B r0Tg3cDnXG+ElMAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1690904942; 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=3l/+ixKOtQP7WwaWMjsaOmjumffB7vALDDS/TZBQp1s=; b=BzQ3cTkNDce+xGE77VYxEAPhcapBxJm91HC69Byc5yQ4ZDZn4Bb7DfwKzUiii4xE4lS+5N 76lF9AJSl9dpZ4xtB23htkin+UbiMYhubapAP9mNyMpvFzOc8tNY1IJ8IWExkx8I2iozSz I9UBZZOBnavLoP1L35NlpQn3DXh1deM46b8AjAxGqx6i2Z5DrD+y5OSjgJHCVn6nTT6xHs zUnwkNQKIU41Jt5Y/ur00oSovdWJZ6JYGLApk6KgbXzfSRlKln88//QR2Mj129fSUtTN3p ATAbicw3/K3v0qaG/BWewZnX690Dp3nkNu3K0UXdpt/B5svbc8fPipxboytE8g== From: Stefan Schantl <stefan.schantl@ipfire.org> To: development@lists.ipfire.org Subject: [PATCHv2 05/12] extrahd.cgi: Add is_configured function. Date: Tue, 1 Aug 2023 17:48:32 +0200 Message-Id: <20230801154839.2373-5-stefan.schantl@ipfire.org> In-Reply-To: <20230801154839.2373-1-stefan.schantl@ipfire.org> References: <20230801154839.2373-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
[PATCHv2,01/12] extrahd.cgi: Add various perl functions deal with block devices
|
|
Commit Message
Stefan Schantl
Aug. 1, 2023, 3:48 p.m. UTC
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
html/cgi-bin/extrahd.cgi | 12 ++++++++++++
1 file changed, 12 insertions(+)
Comments
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Am 01.08.2023 um 17:48 schrieb Stefan Schantl: > Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> > --- > html/cgi-bin/extrahd.cgi | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi > index bb0c22610..4db540aae 100644 > --- a/html/cgi-bin/extrahd.cgi > +++ b/html/cgi-bin/extrahd.cgi > @@ -690,3 +690,15 @@ sub is_swap ($) { > > return 1 if(grep /$device/, @swaps); > } > + > +# > +## Returns "True" if a drive is a configured one. > +# > +sub is_configured ($) { > + my ($path) = @_; > + > + # Loop through the hash of configured drives. > + foreach my $uuid (keys %configured_drives) { > + return 1 if($configured_drives{$uuid} eq "$path"); > + } > +}
diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index bb0c22610..4db540aae 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -690,3 +690,15 @@ sub is_swap ($) { return 1 if(grep /$device/, @swaps); } + +# +## Returns "True" if a drive is a configured one. +# +sub is_configured ($) { + my ($path) = @_; + + # Loop through the hash of configured drives. + foreach my $uuid (keys %configured_drives) { + return 1 if($configured_drives{$uuid} eq "$path"); + } +}