]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
extrahd.cgi: Add is_configured function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 16 Jun 2023 22:21:49 +0000 (00:21 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 10 Jul 2023 19:22:41 +0000 (21:22 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/extrahd.cgi

index bb0c2261021a8ea7b474e480a43bf6c2cf8fe8d1..4db540aae423e5654485f37a8073c708377a6b8e 100644 (file)
@@ -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");
+       }
+}