monolithic/overlay/hooks/entrypoint-pre.d/20_perms_check.sh
VibroAxe faa6b3969d Rebase generic off monolithic
This commit rebases the generic code into the monolithic image
This allows the base image to be the more regularly accessed / edited image

Commits to lancachenet/generic:switcheroo will mimic this commit

Also fixes lancachenet/generic#108
2021-07-20 12:04:38 +00:00

14 lines
550 B
Bash

#!/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
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