Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions overlay/hooks/entrypoint-pre.d/20_perms_check.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash
if [ -d "/data/cache/cache" ]; then
echo "Running fast permissions check"
ls -l /data/cache/cache | tail --lines=+2 | grep -v ${WEBUSER} > /dev/null

echo "Running fast permissions check - listing files that fail permission check:"
su - ${WEBUSER} -c 'find /data/cache/cache -maxdepth 1 ! -readable -o ! -writable | grep . && exit 1 || exit 0'
if [[ $? -eq 0 || "$FORCE_PERMS_CHECK" == "true" ]]; then
echo "Doing full checking of permissions (This WILL take a long time on large caches)..."
find /data \! -user ${WEBUSER} -exec chown ${WEBUSER}:${WEBUSER} '{}' +
echo "Permissions ok"
else
echo "Fast permissions check successful, if you have any permissions error try running with -e FORCE_PERMS_CHECK = true"
fi

fi