The following code does a chown -R across file system boundaries. Unfortunately neither busybox chown (nor gnu chown) do have -xdev option. The -P option is the default - but doesn’t help as this stops following symbolic links but does allow crossing the file system boundary.
The code can mistakenly reset ownership (that it may not have too)
A few ideas
- check that there are no filesystems mounted under the $i
- create a new variable and
- Set the default option not to do the chown
- only set ownership of if
docker.linuxserver.plex does the mkdir
|
for i in "$V_config" "$V_data_tvshows" "$V_data_movies" "$V_transcode" "$V_data_photos"; do |
|
if [ ! "$(ls -nd $i | awk '{print $3}')" = "$E_PUID" ]; then |
|
echo "attempting chown ${E_PUID}/${E_PGID} on $i" |
|
chown -R "${E_PUID}":"${E_PGID}" "$i" 2>&1 >/dev/null |
|
echo "chown attempt completed, moving on" |
|
else |
|
echo "skipping chown, make sure the folder $i is accessible by the user ${E_PUID}:${E_PGID}" |
|
fi |
|
done |
The following code does a
chown -Racross file system boundaries. Unfortunately neither busybox chown (nor gnu chown) do have -xdev option. The -P option is the default - but doesn’t help as this stops following symbolic links but does allow crossing the file system boundary.The code can mistakenly reset ownership (that it may not have too)
A few ideas
docker.linuxserver.plexdoes themkdirlibreelec-addon-repo/docker.linuxserver.plex/bin/docker.linuxserver.plex
Lines 44 to 52 in 2ffa76e