check if a file can really get written to target directory

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2021-12-01 01:34:16 +01:00
parent 1ff0576ee5
commit c3fc6817b5

View file

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