Page 2 of 2

Re: Hacked websites and VestaCP

Posted: Fri Nov 10, 2017 2:59 am
by plutocrat
Something like this would work. Just a quick and dirty prototype

Code: Select all

#!/bin/bash

for URL in \
	/home/admin/web/domain.com/public_html/ \
	/home/admin/web/sub.other.com/public_html/blog/ \
	/home/user/web/third.com/public_html/
do
	WPUSER=$( echo $URL  | awk -F "/" '{ print $3}' )

	WPCMD="sudo -u $WPUSER -i -- /usr/local/bin/wp-cli --path=$URL"

	echo " ------ $URL -------" >> output.txt
	$WPCMD core check-update  >> output.txt
	$WPCMD plugin list >> output.txt

done

mutt -s "Report for $(hostname -f)" [email protected] < output.txt

rm output.txt

Re: Hacked websites and VestaCP

Posted: Fri Nov 10, 2017 7:48 am
by Spheerys
Nice script ! Thanks :)

Re: Hacked websites and VestaCP

Posted: Mon Apr 09, 2018 6:59 am
by baoang
plutocrat wrote:
Mon Nov 06, 2017 4:25 am
As a service to your customers, you might consider writing a script to get wp-cli to check for un-updated plugins and wp installations. It could send out an automated email if it found many updates.

It could even perform the upgrades if you wanted, but that might be a bit intrusive.

http://wp-cli.org/
It seems wp-cli and EE (https://easyengine.io/) have cooperation. EE only runs on Debian and Ubuntu, and with-out ui.