]> 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>
Sun, 5 May 2024 12:47:48 +0000 (14:47 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 5 May 2024 12:47:48 +0000 (14:47 +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 28c84fade954267b22ac0655ce03677171d77e19..22f0902b5813df57d082c8552f57c059ead7b22a 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.