]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/blobdiff - config/cfgroot/ids-functions.pl
ids-functions.pl: Proper return N/A if no ruleset date could be
[people/stevee/ipfire-2.x.git] / config / cfgroot / ids-functions.pl
index b2e1a55200f295e9425f234b8e35603f696f4706..64d98a38823cfe5f78184bbbb3d83be9540caac7 100644 (file)
@@ -1512,15 +1512,15 @@ sub get_ruleset_date($) {
        # Get timestamp the file creation.
        my $mtime = $stat->mtime;
 
+       # Check if the timestamp has not been grabbed.
+       unless ($mtime) {
+               # Return N/A for Not available.
+               return "N/A";
+       }
+
        # Convert into human read-able format.
        $date = strftime('%Y-%m-%d %H:%M:%S', localtime($mtime));
 
-       # Check if a date has been obtained.
-       unless ($date) {
-               # Assign N/A for Not available.
-               $date = "N/A";
-       }
-
        # Return the date.
        return $date;
 }