Last active
April 27, 2022 14:38
-
-
Save iarp/d1442ae1e7a982390cf131564a498e61 to your computer and use it in GitHub Desktop.
Corrects file permission issues on gitea repos after unraid newperms accidental run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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