Created
January 3, 2020 01:07
-
-
Save CapWebSolutions/fca7ecb353d0256c6f79f501b35ed5bd to your computer and use it in GitHub Desktop.
Perform MainWP Security scan on all configured sites from terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This script is executed from a terminal prompt at the root of your MainWP WordPress website | |
# | |
# Execute MainWP CLI command to generate a list of all configured sites in MainWP | |
# Pipe output through filter to remove columns 3 and 4 of output. These columns hold the 2 digit site number. Adjust if more than 99 sites. | |
# Pipe that output to get rid of the comment lines in the site listing. | |
# Pipe that output through the SED editor inserting the security scan command at the beginning of the line | |
# Send everything to a shell script to be executed. | |
wp mainwp sites | cut -c3-4 | grep -E '([0-9]|[0-9][0-9])' | sed 's/^/wp mainwp-sucuri scan /' > sec-scan-auto.sh | |
# | |
# Make the newly created shell script executable. | |
chmod +x sec-scan-auto.sh | |
# | |
# Run the schell script and watch the progress. Could pipe the output to a text file to keep track of results. | |
./sec-scan-auto.sh |
Really nice job ;)
Hey there BillyB0y,
Make sure you are running the script in the root of your WordPress install that has MainWP activated. It runs on WP CLI. If you can run CLI in the folder where this script lives, you should be good to go.
Here is the latest version I have been using for a few months. Still a work in progress.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./sec-scan-v5.sh > scan-results.txt