+ winter restore perms quick helper
* wordpress quick script moved into subfolder
This commit is contained in:
31
wordpress/quick/restore-perms-light.sh.example
Normal file
31
wordpress/quick/restore-perms-light.sh.example
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
WP_CONTENT_DIRS=(
|
||||
plugins
|
||||
upgrade
|
||||
uploads
|
||||
themes
|
||||
)
|
||||
|
||||
export WEB_GID=33
|
||||
|
||||
perms() {
|
||||
sudo chown -R $UID:$WEB_GID "$1"
|
||||
sudo chmod -R g+rwx "$1"
|
||||
}
|
||||
|
||||
permsFile() {
|
||||
sudo chown $UID:$WEB_GID "$1"
|
||||
sudo chmod g+rw "$1"
|
||||
}
|
||||
|
||||
for DIR in "${WP_CONTENT_DIRS[@]}"; do
|
||||
DIR="$SCRIPT_DIR/../wp-content/$DIR"
|
||||
|
||||
if [[ -f $DIR ]]; then
|
||||
permsFile "$DIR"
|
||||
else
|
||||
perms "$DIR"
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user