Created
July 12, 2019 14:36
-
-
Save MaxLazar/928848211f56bd1f244511e2d0574b6e to your computer and use it in GitHub Desktop.
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/bash | |
# Find location of this script. | |
# This ensures that only files in the directory in | |
# which this script exists (recursively) are modified. | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# Set what the name of your expressionengine folders are. | |
SYSTEM="system" | |
IMAGES_DIR="public_html/images" | |
UPLOADS_DIR="public_html/files" | |
# Optionally ensure correct ownership on per environment basis. | |
#if [ "$DIR" = "/path/to/project/" ]; then | |
# chown -R http.http "$DIR" | |
#fi | |
# Expressionengine specific permissions. | |
find "$DIR" -type d -print0 | xargs -0 chmod 0755 | |
find "$DIR" -type f -print0 | xargs -0 chmod 0644 | |
find "$DIR/$IMAGES_DIR/" -type d -print0 | xargs -0 chmod -R go+w | |
find "$DIR/$UPLOADS_DIR/" -type d -print0 | xargs -0 chmod -R go+w | |
chmod -R go+w "$DIR/$SYSTEM/user/templates" | |
chmod -R go+w "$DIR/$SYSTEM/user/cache" | |
chmod 0666 "$DIR/$SYSTEM/user/config/config.php" | |
# Permissions specific to the sitemap generator | |
# from http://www.xml-sitemaps.com/. | |
#chmod -R 0777 "$DIR/public_html/generator/data" | |
#chmod 0666 "$DIR/public_html/sitemap.xml" | |
#chmod 0666 "$DIR/public_html/ror.xml" | |
#chmod 0600 "$DIR/public_html/index.php" | |
# If laxative is being used, preserve executability | |
#if [ -e "$DIR/.db/lax" ]; then | |
# chmod 0700 "$DIR/.db/lax" | |
#fi | |
# Make sure other shell scripts are executable too. | |
find "$DIR" -type f -name "*.sh" -print0 | xargs -0 chmod 700 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment