Kerstin Puschke
2010-Mar-23  11:02 UTC
[Logcheck-devel] [PATCH] commit 9a4c9f8949768da31520dd8b4780875dc2da231d Author: Kerstin Puschke <kpuschke@zedat.fu-berlin.de> Date: Tue Mar 23 11:12:01 2010 +0100
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>
---
 src/logcheck |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/logcheck b/src/logcheck
index 2bc0995..c23cd5f 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
 }
-- 
1.6.6.1
Hannes von Haugwitz
2010-Apr-13  07:51 UTC
[Logcheck-devel] [PATCH] commit 9a4c9f8949768da31520dd8b4780875dc2da231d Author: Kerstin Puschke <kpuschke@zedat.fu-berlin.de> Date: Tue Mar 23 11:12:01 2010 +0100
Applied to git, thanks for contribution. Greetings Hannes Kerstin Puschke wrote:> 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> > --- > src/logcheck | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/logcheck b/src/logcheck > index 2bc0995..c23cd5f 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 > }