]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids.cgi: Use ids-functions.pl for checking available discspace
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 14 Feb 2018 07:20:50 +0000 (08:20 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 26 Jul 2018 09:56:03 +0000 (11:56 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index 40bb820a516d8b516221c341f8e126afffee3f5b..926d5adbe26f677ff621be8bb430fc31c3e721d5 100644 (file)
@@ -279,30 +279,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'update'}) {
                $errormessage = $Lang::tr{'could not download latest updates'};
        }
 
-       # Call diskfree to gather the free disk space of /var.
-       my @df = `/bin/df -B M /var`;
-
-       # Loop through the output.
-       foreach my $line (@df) {
-               # Ignore header line.
-               next if $line =~ m/^Filesystem/;
-
-               # Search for a line with the device information.
-               if ($line =~ m/dev/ ) {
-                       # Split the line into single pieces.
-                       my @values = split(' ', $line);
-                       my ($filesystem, $blocks, $used, $available, $used_perenctage, $mounted_on) = @values;
-
-                       # Check if the available disk space is more than 300MB.
-                       if ($available < 300) {
-                               # If there is not enough space, print out an error message.
-                               $errormessage = "$Lang::tr{'not enough disk space'} < 300MB, /var $1MB";
-
-                               # Break loop.
-                               last;
-                       }
-               }
-       }
+       # Check if there is enought free disk space available.
+       $errormessage = &IDS::checkdiskspace();
 
        # Check if any errors happend.
        unless ($errormessage) {