From 2fbfd0a8fa5918e620cb86010ab9ff97d1e537b8 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Fri, 6 Dec 2024 10:02:07 +0100 Subject: [PATCH] fix: dev: [logrotate] clean code !minor --- logrotate/build/src/entrypoint.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/logrotate/build/src/entrypoint.sh b/logrotate/build/src/entrypoint.sh index 453d12b..951ad42 100755 --- a/logrotate/build/src/entrypoint.sh +++ b/logrotate/build/src/entrypoint.sh @@ -1,13 +1,12 @@ #!/bin/sh # Clean non existent log file entries from status file -cd /var/lib/logrotate +cd /var/lib/logrotate || return 1 test -e status || touch status head -1 status > status.clean -sed 's/"//g' status | while read logfile date -do +sed 's/"//g' status | while read -r logfile date; do [ -e "$logfile" ] && echo "\"$logfile\" $date" done >> status.clean mv status.clean status -/usr/sbin/logrotate -v -s /var/lib/logrotate/status /etc/logrotate.conf +exec /usr/sbin/logrotate -v -s /var/lib/logrotate/status /etc/logrotate.conf