From c3fc6817b5721e1770efaf80091bbaa2e9c6d84a Mon Sep 17 00:00:00 2001 From: szaimen Date: Wed, 1 Dec 2021 01:34:16 +0100 Subject: [PATCH] check if a file can really get written to target directory Signed-off-by: szaimen --- Containers/mastercontainer/start.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index ebddb6fc..ba4aea17 100644 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -21,6 +21,15 @@ if ! [ -w /mnt/docker-aio-config ]; then exit 1 fi +# Try to create a file +touch /mnt/docker-aio-config/test +if ! [ -f /mnt/docker-aio-config/test ]; then + echo "Could not create a testfile. Probably don't have enough permissions in the data directory." + exit 1 +else + rm -f /mnt/docker-aio-config/test +fi + # Check if api version is supported API_VERSION_FILE="$(find ./ -name DockerActionManager.php | head -1)" API_VERSION="$(grep -oP 'const API_VERSION.*\;' "$API_VERSION_FILE" | grep -oP [0-9]+.[0-9]+ | head -1)"