From ae6d88c55ecc0f6d55e66d1117bdfa6278fa4ec5 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 4 Dec 2024 12:47:59 -0300 Subject: [PATCH] fix: don't copy the database if it already exists --- access_logd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/access_logd.sh b/access_logd.sh index c57d1d5..90a75f3 100755 --- a/access_logd.sh +++ b/access_logd.sh @@ -12,10 +12,10 @@ case $1 in start) pgrep /usr/bin/access_log && exit 0 - # Copy default database - install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3 + # Copy default database if it doesn't exist + test -f /var/log/access_log.sqlite3 || install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3 - # Remove socket if previous run ended suddendly + # Remove socket if previous run ended suddenly rm -f /tmp/access_log.socket # Read from fifo and load into database