fix: don't copy the database if it already exists
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2024-12-04 12:47:59 -03:00
parent e166617164
commit ae6d88c55e
No known key found for this signature in database

View file

@ -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