diff options
Diffstat (limited to 'docker/start.sh')
-rwxr-xr-x | docker/start.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docker/start.sh b/docker/start.sh index b37acfe2..0ac47da9 100755 --- a/docker/start.sh +++ b/docker/start.sh @@ -31,8 +31,12 @@ cleanup() { } create_volume_subfolder() { - # Modify the owner of /data dir, make $USER(git) user have permission to create sub-dir in /data. - chown -R "$USER:$USER" /data + # only change ownership if needed, if using an nfs mount this could be expensive + if [ "$USER:$USER" != "$(stat /data -c '%U:%G')" ] + then + # Modify the owner of /data dir, make $USER(git) user have permission to create sub-dir in /data. + chown -R "$USER:$USER" /data + fi # Create VOLUME subfolder for f in /data/gogs/data /data/gogs/conf /data/gogs/log /data/git /data/ssh; do |