Skip to content

Instantly share code, notes, and snippets.

@hforbess
Created July 22, 2017 19:28
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 hforbess/673e00089287d4a8daf61825c207c145 to your computer and use it in GitHub Desktop.
Save hforbess/673e00089287d4a8daf61825c207c145 to your computer and use it in GitHub Desktop.
Set correct perms for web pages shell script
#!/bin/bash
user=$1
if [ $user ]
then
find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;
chown $user:ghost .
chown -R $user:ghost *
else
echo "You must provide a user as a parameter."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment