[Logcheck-commits] Kerstin Puschke: Look for header.txt and footer. txt in $RULEDIR instead of hardcoded /etc/logcheck

Hannes von Haugwitz hvh-guest at alioth.debian.org
Mon Apr 12 06:55:42 UTC 2010


Module: logcheck
Branch: master
Commit: bb444d6eeb653c17cc75320e9d0fc86f477b5e3d
URL:    http://git.debian.org/?p=logcheck/logcheck.git;a=commit;h=bb444d6eeb653c17cc75320e9d0fc86f477b5e3d

Author: Kerstin Puschke <kpuschke at zedat.fu-berlin.de>
Date:   Mon Apr 12 08:28:30 2010 +0200

Look for header.txt and footer.txt in $RULEDIR instead of hardcoded /etc/logcheck

This makes header.txt. and footer.txt customizable even if using a non-default rule directory.

Signed-off-by: Kerstin Puschke <kpuschke at zedat.fu-berlin.de>
Signed-off-by: Hannes von Haugwitz <hannes at vonhaugwitz.com>

---

 src/logcheck |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/logcheck b/src/logcheck
index 3622f95..c549053 100755
--- a/src/logcheck
+++ b/src/logcheck
@@ -188,8 +188,8 @@ EOF
 
 # Add an identification line at the beginning of the sent mail
 setintro() {
-    if [ -f /etc/logcheck/header.txt -a -r /etc/logcheck/header.txt ] ; then
-       $CAT /etc/logcheck/header.txt >> "$TMPDIR/report" \
+    if [ -f "$RULEDIR/header.txt" -a -r "$RULEDIR/header.txt" ] ; then
+       $CAT "$RULEDIR/header.txt" >> "$TMPDIR/report" \
            || error "Could not append header to $TMPDIR/report."
     fi
 }
@@ -197,8 +197,8 @@ setintro() {
 
 # Add a footer to the report.
 setfooter() {
-    if [ -f /etc/logcheck/footer.txt -a -r /etc/logcheck/footer.txt ] ; then
-       $CAT /etc/logcheck/footer.txt >> "$TMPDIR/report" \
+    if [ -f "$RULEDIR/footer.txt" -a -r "$RULEDIR/footer.txt" ] ; then
+       $CAT "$RULEDIR/footer.txt" >> "$TMPDIR/report" \
            || error "Could not append footer to $TMPDIR/report."
     fi
 }




More information about the Logcheck-commits mailing list