From 35653eec54bb105cc383a5cbd255fc1ad0791d32 Mon Sep 17 00:00:00 2001 From: Peca Date: Sat, 26 Jul 2025 22:00:22 +0200 Subject: [PATCH] Add WordFence CLI installation script --- bin/v-desinfect-wordpress | 5 +++++ bin/v-install-wordfence-cli | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/bin/v-desinfect-wordpress b/bin/v-desinfect-wordpress index fcdc2f66..51ee217e 100644 --- a/bin/v-desinfect-wordpress +++ b/bin/v-desinfect-wordpress @@ -27,6 +27,11 @@ if [ -z "$user" ]; then exit 1 fi +if [ ! -f "/usr/local/vesta/bin/v-wf-malware-hyperscan-with-remediate" ]; then + echo "= WordFence CLI is not installed. Installing..." + /usr/local/vesta/bin/v-install-wordfence-cli +fi + # absolute paths to maintenance scripts, in desired order declare -a tasks=( "/usr/local/vesta/bin/v-change-database-password-for-wordpress" diff --git a/bin/v-install-wordfence-cli b/bin/v-install-wordfence-cli index e69de29b..fc6ca0b5 100644 --- a/bin/v-install-wordfence-cli +++ b/bin/v-install-wordfence-cli @@ -0,0 +1,37 @@ +#!/bin/bash +# info: Script for installing WordFence CLI +# options: NONE + +if ! command -v git &> /dev/null; then + echo "= Git is not installed. Installing..." + apt-get update > /dev/null 2>&1 + apt-get install -y git +fi + +cd /root + +if [ ! -d "myvesta-wordfence-cli" ]; then + git clone https://github.com/isscbta/myvesta-wordfence-cli.git + cd ~/myvesta-wordfence-cli/ +else + cd ~/myvesta-wordfence-cli/ + git pull +fi + +echo "" +echo "----------------------------------------------------------------" +echo "" +echo "Which Docker container do you want to install for WordFence CLI?" +echo "1. WordFence CLI official Docker container" +echo "2. WordFence CLI Docker container maintained by myVesta" +read -r -p "Enter your choice: " choice < /dev/tty + +if [ "$choice" == "1" ]; then + bash wf-cli-install.sh +fi + +if [ "$choice" == "2" ]; then + bash wf-cli-install-our-image.sh +fi + +exit 0;