From e51cd34f77125494963aea14ae887380b9bb03b9 Mon Sep 17 00:00:00 2001 From: isscbta <53144593+isscbta@users.noreply.github.com> Date: Wed, 22 May 2024 17:51:42 +0200 Subject: [PATCH] Update v-add-wordpress-admin --- bin/v-add-wordpress-admin | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/v-add-wordpress-admin b/bin/v-add-wordpress-admin index a5fb98a6..4fc71c05 100644 --- a/bin/v-add-wordpress-admin +++ b/bin/v-add-wordpress-admin @@ -53,7 +53,11 @@ if [ ! -d "/home/$user/web/$domain/public_html" ]; then exit 1; fi -# Check if WP CLI is installed and install it if not +if [ ! -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then + echo 'Please install WordPress first.' + exit 1; +fi + if ! command -v wp &> /dev/null; then echo "WP CLI is not installed. Installing..." wget -nv https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/local/bin/wp