diff options
author | Erich Eckner <git@eckner.net> | 2019-09-17 11:21:24 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-09-17 11:21:24 +0200 |
commit | 119b9ded33188a5acfe14a4e6ea7e2fae9a36ba5 (patch) | |
tree | 9bb00ada5f632042431de10e9107a98a78011abf /doalogwatch.in | |
parent | 4e9ceab1151fcd0b8fcfbd8b0560752ca0b17bcc (diff) | |
download | logwatch-extra-119b9ded33188a5acfe14a4e6ea7e2fae9a36ba5.tar.xz |
dummys neu
Diffstat (limited to 'doalogwatch.in')
-rwxr-xr-x | doalogwatch.in | 19 |
1 files changed, 18 insertions, 1 deletions
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}" |