Skip to content

Instantly share code, notes, and snippets.

@iarp
Last active April 27, 2022 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iarp/d1442ae1e7a982390cf131564a498e61 to your computer and use it in GitHub Desktop.
Save iarp/d1442ae1e7a982390cf131564a498e61 to your computer and use it in GitHub Desktop.
Corrects file permission issues on gitea repos after unraid newperms accidental run
cd /mnt/user/repos/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 755 {} \;
find objects/ -type d -exec chmod 755 {} \;
find info/ -type f -exec chmod 644 {} \;
find refs/ -type f -exec chmod 644 {} \;
find objects/ -type f -exec chmod 444 {} \;
find objects/info/ -type f -exec chmod 644 {} \;
chown -R iarp:1000 ./
chmod 644 HEAD config description
for d in /mnt/user/archived/repos/*/*; do
cd $d
pwd
if [[ $(stat -L -c "%a" $d/HEAD) == 666 ]] ; then
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 755 {} \;
find objects/ -type d -exec chmod 755 {} \;
find info/ -type f -exec chmod 644 {} \;
find refs/ -type f -exec chmod 644 {} \;
find objects/ -type f -exec chmod 444 {} \;
find objects/info/ -type f -exec chmod 644 {} \;
chown -R iarp:1000 ./
chmod 644 HEAD config description
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment