From: Stefan Schantl Date: Wed, 14 Feb 2018 07:20:50 +0000 (+0100) Subject: ids.cgi: Use ids-functions.pl for checking available discspace X-Git-Tag: suricata-beta3~33^2~39^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59052432f4cc108631a9b264f2f48aaf6ea76873;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Use ids-functions.pl for checking available discspace Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 40bb820a51..926d5adbe2 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -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) {