You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
370 B

1 year ago
  1. #!/bin/bash
  2. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. WP_CONTENT_DIRS=(
  4. plugins
  5. upgrade
  6. uploads
  7. )
  8. export WEB_GID=33
  9. perms() {
  10. sudo chown -R $UID:$WEB_GID "$1"
  11. find "$1" -type d -exec chmod g+rwx '{}' \;
  12. find "$1" -type f -exec chmod g+rw '{}' \;
  13. }
  14. for DIR in "${WP_CONTENT_DIRS[@]}"; do
  15. perms "$SCRIPT_DIR/../wp-content/$DIR"
  16. done