Last active
April 17, 2024 17:39
-
-
Save GussRw/081e28eff59b0cf410c294143608665d to your computer and use it in GitHub Desktop.
Project Permissions
This file contains 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
if [ -z "$1" ] | |
then | |
echo "No group argument supplied" | |
exit | |
fi | |
if [ -z "$2" ] | |
then | |
echo "No project folder argument supplied" | |
exit | |
fi | |
if grep -q $1 /etc/group | |
then | |
if [ -d "$2" ] | |
then | |
chmod -R 775 $2 | |
chown -R root:$1 $2 | |
cd $2 && chown -R www-data public storage bootstrap/cache dist | |
setfacl -dRm g:$1:rwx $2 | |
find $2 -type d -exec chmod g+s '{}' \; | |
else | |
echo "Error: Directory $2 does not exists" | |
fi | |
else | |
echo "Group $1 does not exist" | |
exit | |
fi | |
echo "Folder $2 was update with $1 group permissions" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment