]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
filesystem-functions.pl: Add some defaults to volumes_status() function
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 3 Jul 2025 14:54:21 +0000 (16:54 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 3 Jul 2025 14:54:21 +0000 (16:54 +0200)
Defaults if not other specified to only collect data from mounted
devices. Do not grab any uuid details from those volumes and also do
not try to determine the disk usage.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/filesystem-functions.pl

index 9f563397058f3d533b851897bd5ce12daba8b900..7c986b657ab505641c1639c3e801cfed4d213fe0 100644 (file)
@@ -67,6 +67,16 @@ sub volumes_status (%) {
        my (%options) = @_;
        my %volumes;
 
+       # Defaults.
+       my %defaults = (
+               "devices" => "mounted",
+               "uuids" => "False",
+               "df" => "False"
+       );
+
+       # Merge and overwrite the defaults with the given options.
+       %options = (%defaults, %options);
+
        # Grab all available devices if requested.
        if($options{'devices'} eq "all") {
                # Get all available devices.