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 | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Original author: Michael Conigliaro (https://gist.github.com/macbleser/9136424) | |
| # Modified by willfull on 17 January 2017 (https://gist.github.com/willfull/3fe400a3ec0abc8e6ea3fba56a1bfd59) | |
| # | |
| WP_ROOT=${1:-.} # <-- wordpress root directory, current directory by default | |
| [ -e "$WP_ROOT/wp-config.php" ] || { echo "Usage: $0 /path/to/wordpress"; exit; } # <-- detect that the directory is a wordpress root |