summaryrefslogtreecommitdiff
blob: 4a0f33be7aed804172fec41fc296f813dcd8032b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Submitted by: Heath Caldwell <hncaldwell@gentoo.org>
Date: 2008-10-21
Initial Package Version: 0.10
Upstream Status: No response
Description: Warns on log files that tenshi can't open and continues monitoring the ones that it can, instead of just exiting.

diff -ur tenshi-0.10/tenshi tenshi-0.10.new/tenshi
--- tenshi-0.10/tenshi	2008-10-06 16:55:37.000000000 -0700
+++ tenshi-0.10.new/tenshi	2008-10-07 11:46:06.000000000 -0700
@@ -141,10 +141,22 @@
         die RED "[ERROR] $main{'csv'}{'path'}: not executable";
     }
 
+    my @good_log_files;
     foreach my $log (@log_files) {
-        die RED "[ERROR] $log: no such file"      if (! -f $log);
-        die RED "[ERROR] $log: file not readable" if (! -r $log);
+        unless (-f $log) {
+            print STDERR RED "[WARNING] $log: no such file\n";
+            next;
+        }
+
+        unless (-r $log) {
+            print STDERR RED "[WARNING] $log: file not readable\n";
+            next;
+        }
+
+        push @good_log_files, $log;
     }
+    @good_log_files > 0 or die RED "[ERROR] no readable log files";
+    @log_files = @good_log_files;
 }
 
 #