From 9fceea420309c2334241ed3a60fd9f47e7428217 Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Wed, 18 Jul 2018 08:45:16 +0100 Subject: Only mkdir and touch if needed --- 2.4/docker-entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2.4/docker-entrypoint.sh b/2.4/docker-entrypoint.sh index 5840b23..84bf8e1 100755 --- a/2.4/docker-entrypoint.sh +++ b/2.4/docker-entrypoint.sh @@ -99,8 +99,8 @@ if [ -e /privkey.pem ] && [ -e /cert.pem ]; then fi # Create directories for Dav data and lock database. -mkdir -p "/var/lib/dav/data" -touch "/var/lib/dav/DavLock" +[ ! -d "/var/lib/dav/data" ] && mkdir -p "/var/lib/dav/data" +[ ! -e "/var/lib/dav/DavLock" ] && touch "/var/lib/dav/DavLock" chown -R www-data:www-data "/var/lib/dav" exec "$@" -- cgit v1.2.3