]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
extrahd.cgi: Add is_configured function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 1 Aug 2023 15:48:32 +0000 (17:48 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Aug 2023 09:11:57 +0000 (09:11 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@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");
+       }
+}