Skip to content

Instantly share code, notes, and snippets.

@faelp22
Created October 6, 2017 14:20
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 faelp22/92b371e33298d23cf90c971097dfdfd4 to your computer and use it in GitHub Desktop.
Save faelp22/92b371e33298d23cf90c971097dfdfd4 to your computer and use it in GitHub Desktop.
Aplica permissões de segurança para WordPress
#!/bin/bash
#
# Aplica permissões de segurança para WordPress
#
# Autor: Isael Sousa <faelp22@gmail.com>
# Data: 06/10/2017 as 11:18
# V 1.0
#
#
echo "Aplicando permissões de arquivos"
find . -type f -exec chmod 644 {} \;
chmod 404 .htaccess
chmod 400 wp-config.php
if [ -e "debug.log" ]; then
chmod 600 debug.log
fi
echo "Aplicando permissões de pastas"
find . -type d -exec chmod 755 {} \;
echo "Removendo arquivos desnecessários"
for file in "readme.html" "license.txt" "wp-config-sample.php"; do
if [ -e $file ]; then
rm $file
fi
done
echo "Finalizado"
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment