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