mirror of
https://github.com/linuxserver/docker-code-server
synced 2025-06-26 18:27:40 +00:00
only chown when ownership change or new install detected
This commit is contained in:
@@ -26,14 +26,14 @@ if [[ ! -f /config/.profile ]]; then
|
||||
cp /root/.profile /config/.profile
|
||||
fi
|
||||
|
||||
# fix permissions (ignore contents of workspace and cache folders)
|
||||
find /config \
|
||||
-path "/config/workspace" -prune -o \
|
||||
-path "/config/.npm" -prune -o \
|
||||
-path "/config/.rustup" -prune -o \
|
||||
-path "/config/.cargo" -prune -o \
|
||||
-exec lsiown abc:abc {} +
|
||||
lsiown abc:abc /config/workspace
|
||||
# fix permissions (ignore contents of workspace)
|
||||
PUID=${PUID:-911}
|
||||
if [[ ! "$(stat -c %u /config/.profile)" == "${PUID}" ]]; then
|
||||
echo "Change in ownership or new install detected, please be patient while we chown existing files"
|
||||
echo "This could take some time"
|
||||
find /config -path "/config/workspace" -prune -o -exec lsiown abc:abc {} +
|
||||
lsiown abc:abc /config/workspace
|
||||
fi
|
||||
chmod 700 /config/.ssh
|
||||
if [[ -n "$(ls -A /config/.ssh)" ]]; then
|
||||
find /config/.ssh/ -type d -exec chmod 700 '{}' \;
|
||||
|
||||
Reference in New Issue
Block a user