diff options
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | doalogwatch.in | 19 | ||||
-rw-r--r-- | dummy | 0 | ||||
-rw-r--r-- | dummy.conf | 2 |
4 files changed, 23 insertions, 1 deletions
@@ -25,6 +25,7 @@ CRONDIR = /etc/cron.daily BINDIR = /usr/bin CACHEDIR = /var/cache MANDIR = /usr/share/man +LOGWATCHDIR = /usr/share/logwatch TMPDIR = /tmp WAITDIR = /home/shutdown/.warteauf @@ -48,6 +49,8 @@ install: all install -D -m0755 -t $(DESTDIR)$(BINDIR) doalogwatch install -D -m0755 doalogwatch.cron $(DESTDIR)$(CRONDIR)/doalogwatch install -d $(DESTDIR)$(CACHEDIR)/logwatch + install -D -m0644 -t $(DESTDIR)$(LOGWATCHDIR)/default.conf/services dummy.conf + install -D -m0644 -t $(DESTDIR)$(LOGWATCHDIR)/scripts/services dummy clean: rm -f doalogwatch doalogwatch.cron diff --git a/doalogwatch.in b/doalogwatch.in index 1874eb9..a08b3bd 100755 --- a/doalogwatch.in +++ b/doalogwatch.in @@ -14,6 +14,22 @@ warteAufFile="#WAITDIR#/logwatch" [ "${abWannNaechstesMal}" == "$(cat "${lmDatei}")" ] && \ exit 0 +if [ -r '#ETCDIR#/logwatch/conf/logwatch.conf' ]; then + services=$( + sed -n ' + s/^#\s*doalogwatch\s*#\s*Service\s*=\s*// + T + s/^\(["'"'"']\)\(.*\)\1$/\2/ + s/^/--service=/ + p + ' '#ETCDIR#/logwatch/conf/logwatch.conf' + ) +fi + +if [ -z "${services%%--service=-*}" ]; then + services="--service=All ${services}" +fi + [ -r "${warteAufFile}" ] && \ ps aux | \ awk '{print $2" "$(NF)}' | \ @@ -54,7 +70,8 @@ done logwatch \ --archives \ - --range "between $(cat "${lmDatei}") and yesterday" + --range "between $(cat "${lmDatei}") and yesterday" \ + ${services} echo "${abWannNaechstesMal}" > "${lmDatei}" diff --git a/dummy.conf b/dummy.conf new file mode 100644 index 0000000..7dc0939 --- /dev/null +++ b/dummy.conf @@ -0,0 +1,2 @@ +Title = "Dummy target" +LogFile = NONE |