Last active
October 12, 2022 01:12
-
-
Save f4bio/a231708cc95cadd1672770a526cf8a55 to your computer and use it in GitHub Desktop.
fix linux file/folder permissions
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
#!/bin/sh | |
findCmd=${FIND_EXECUTABLE_PATH:-$(which find)} | |
targetGroup=${TARGET_GROUP_NAME:-$(id -ng)} | |
targetUser=${TARGET_USER_NAME:-$(id -nu)} | |
$findCmd $1 -type f -exec chmod 664 {} \; | |
$findCmd $1 -type d -exec chmod 775 {} \; | |
$findCmd $1 -exec chown $targetUser:$targetGroup {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment