2022-03-17 10:14:08 +01:00
|
|
|
#!/bin/bash
|
2022-02-20 12:23:06 +01:00
|
|
|
|
2022-03-23 08:33:44 +01:00
|
|
|
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts"
|
2022-03-23 08:16:01 +01:00
|
|
|
|
2022-02-20 12:23:06 +01:00
|
|
|
######################################## TEST STORAGE FOLDER PERMISSIONS ########################################
|
|
|
|
|
|
|
|
STORAGE_PATH=${PHOTOPRISM_STORAGE_PATH:-/photoprism/storage}
|
|
|
|
|
|
|
|
DOC_URL="https://docs.photoprism.app/getting-started/troubleshooting/docker/#file-permissions"
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# create directory if not exists
|
2022-03-23 08:16:01 +01:00
|
|
|
mkdir -p "${STORAGE_PATH}" || (echo "Failed creating storage folder \"$STORAGE_PATH\", see $DOC_URL" 1>&2; exit 1)
|
2022-02-20 12:23:06 +01:00
|
|
|
|
|
|
|
# create and delete test file
|
2022-03-23 08:16:01 +01:00
|
|
|
(touch "${STORAGE_PATH}/is-writable" 2>/dev/null && rm "${STORAGE_PATH}/is-writable") || \
|
2022-02-20 12:23:06 +01:00
|
|
|
(echo "Failed creating test file in storage folder, see $DOC_URL" 1>&2; exit 1)
|