site command improved

- argument empty error fixed
- cache option install plugins with wrong permissions fixed
This commit is contained in:
Cristhian Martínez Ochoa 2018-10-26 22:03:48 -06:00
parent ce1f8d21a9
commit 14e19177af
2 changed files with 4 additions and 1 deletions

View file

@ -38,6 +38,8 @@ wp_cache_plugins() {
else
echo "${red}Redis Object Cache Plugin is already installed!${end}"
fi
sudo chown -R www-data:www-data /var/www/$domain/htdocs/wp-content/plugins
}
domain_check() {

View file

@ -124,7 +124,7 @@ if [[ "$domain" == "-list" && -z "$type" && -z "$cache" ]]; then
for site in "/var/www"/*
do
domi=$(echo $site | cut -f 4 -d "/")
echo "${gre} - $domi ${end}"
[[ $domi != "html" && $domi != $(conf_read tools-port) ]] && echo "${gre} - $domi ${end}"
done
echo ""
@ -365,6 +365,7 @@ elif [[ "$type" == "-force-redirect" && -a /etc/nginx/sites-available/$domain ]]
elif [[ ! -a /etc/nginx/sites-available/$domain && $type =~ ^(-nocache|-cache|-delete|-off|-on|-ssl-on|-ssl-off|-force-redirect)$ ]]; then
echo "${red}Site $domain doesn't exists!${end}"
else
[[ -z $type ]] && type=$domain
echo "${red} Argument '${type}' is not a valid option! ${end}"
fi