summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-17 11:20:45 +0200
committerErich Eckner <git@eckner.net>2019-09-17 11:20:45 +0200
commit4e9ceab1151fcd0b8fcfbd8b0560752ca0b17bcc (patch)
tree7d649d7db4da4979ab4245a281e81267afedba57
parent902db8ba62def6d04c00fd3b54ed6c4bfff796a6 (diff)
downloadlogwatch-extra-4e9ceab1151fcd0b8fcfbd8b0560752ca0b17bcc.tar.xz
doalogwatch: style
-rwxr-xr-xdoalogwatch.in22
1 files changed, 10 insertions, 12 deletions
diff --git a/doalogwatch.in b/doalogwatch.in
index a70e01a..1874eb9 100755
--- a/doalogwatch.in
+++ b/doalogwatch.in
@@ -24,16 +24,15 @@ if [ -d "${warteAufFile%/*}" ]; then
echo $$ > "${warteAufFile}"
fi
-[ -r #ETCDIR#/backup.conf ] && \
- . #ETCDIR#/backup.conf
+[ -r '#ETCDIR#/backup.conf' ] && \
+ . '#ETCDIR#/backup.conf'
warten=true
-until ! ${warten}
-do
+while ${warten}; do
warten=false
- [ $(cat /proc/uptime | cut -d ' ' -f 1 | sed "s/\..*\$//") -le 300 ] && \
+ [ $(sed 's/[. ].*$//' /proc/uptime) -le 300 ] && \
warten=true
# check for currently running backups
@@ -41,12 +40,9 @@ do
grep -v "\sgrep\s" | \
grep -q "\s\(#BINDIR#/\)\?backup\s" && \
warten=true
- if [ -r #ETCDIR#/backup.conf ]
- then
- for i in 1 2
- do
- for id in "${!backups[@]}"
- do
+ if [ -r '#ETCDIR#/backup.conf' ]; then
+ for i in 1 2; do
+ for id in "${!backups[@]}"; do
[ -e "#TMPDIR#/${id}.pid" ] && \
warten=true
done
@@ -56,7 +52,9 @@ do
done
-logwatch --archives --range "between $(cat "${lmDatei}") and yesterday"
+logwatch \
+ --archives \
+ --range "between $(cat "${lmDatei}") and yesterday"
echo "${abWannNaechstesMal}" > "${lmDatei}"