diff --git a/sbin/wp-cron.sh b/sbin/wp-cron.sh index 88fd174..202ae27 100755 --- a/sbin/wp-cron.sh +++ b/sbin/wp-cron.sh @@ -10,13 +10,21 @@ if [ "$USER" != "root" ]; then exec sudo $0 fi +# create empty virtualhostExclusionArray array (any domains added to this array will be skipped) declare -a virtualhostExclusionArray -# optionally add virtualhosts to virtualhostExclusionArray to have them skipped -# create virtualhostArray +# create virtualhostArray listing all virtualhost on the server cd /srv/www virtualhostArray=(`ls -1|grep -v ^html$`) +# check for local config, which can be used to override either of the above arrays +if [[ -f /usr/local/etc/wp-cron.conf ]]; then + source /usr/local/etc/wp-cron.conf + # conf file could contain either one or both arrays, configured like this: + #virtualhostArray=("example.com" "example.net") + #virtualhostExclusionArray=("example.org") +fi + for VHOST in "${virtualhostArray[@]}" do # check if VHOST has been added to exclustion array