From: Stefan Schantl Date: Tue, 1 Aug 2023 15:48:32 +0000 (+0200) Subject: extrahd.cgi: Add is_configured function. X-Git-Tag: v2.27-core179~9^2~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0aa77c2fd50daccb6dd4d71f05a9fd3a187b993e;p=ipfire-2.x.git extrahd.cgi: Add is_configured function. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index bb0c226102..4db540aae4 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"); + } +}