]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
update-ids-ruleset: Log and abort if to less free disk space is
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 26 Mar 2022 10:22:50 +0000 (11:22 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 26 Mar 2022 10:22:50 +0000 (11:22 +0100)
available.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/scripts/update-ids-ruleset

index 267ccdb254b6602cfd5173ba29ae3cb0a5b4d698..9453f8f8e107c40d233ff4ff22196245bdccb44e 100644 (file)
@@ -65,19 +65,19 @@ if (-f "$IDS::ids_page_lock_file") {
 # Check if the red device is active.
 unless (-e "${General::swroot}/red/active") {
        # Store notice in the syslog.
-       &IDS::_log_to_syslog("The system is offline.");
-
-       # Store error message for displaying in the WUI.
-       &IDS::_store_error_message("$Lang::tr{'could not download latest updates'} - $Lang::tr{'system is offline'}");
+       &_log_to_syslog("<ERROR> Could not update any ruleset - The system is offline.");
 
        # Exit.
        exit 0;
 }
 
 # Check if enought free disk space is availabe.
-if(&IDS::checkdiskspace()) {
-       # Store the error message for displaying in the WUI.
-       &IDS::_store_error_message("$Lang::tr{'not enough disk space'}");
+my $return = &IDS::checkdiskspace();
+
+# Handle error.
+if ($return) {
+       # Store error in syslog.
+       &_log_to_syslog("<ERROR> Not enough free disk space, only $return of 300MB are available.");
 
        # Exit.
        exit 0;