Prechádzať zdrojové kódy

provide the WordPress cron job triggering

Ralf S. Engelschall 19 rokov pred
rodič
commit
9de6848200

+ 7 - 0
wordpress/rc.wordpress

@@ -40,3 +40,10 @@
     rcService wordpress active no  && exit 0
     rc wordpress stop start
 
+%quarterly -u @l_rusr@
+    rcService wordpress enable yes || exit 0
+    rcService wordpress active no  && exit 0
+    if [ ".$wordpress_cron" = .yes ]; then
+        @l_prefix@/sbin/wordpress-cron
+    fi
+

+ 8 - 0
wordpress/wordpress-cron.sh

@@ -0,0 +1,8 @@
+#!/bin/sh
+##
+##  wordpress-cron.sh -- WordPress Cron Job Trigger
+##
+
+server=`grep '^Listen' @l_prefix@/etc/wordpress/wordpress-apache.conf | head -1 | awk '{ print $2; }'`
+@l_prefix@/bin/wget -qO /dev/null http://$server/wp-mail.php >/dev/null 2>&1 || true
+

+ 8 - 3
wordpress/wordpress.spec

@@ -33,13 +33,14 @@ Class:        PLUS
 Group:        CMS
 License:      GPL
 Version:      2.1
-Release:      20070210
+Release:      20070213
 
 #   list of sources
 Source0:      ftp://ftp.openpkg.org/sources/CPY/VERSIONED/wordpress/wordpress-%{version}.tar.gz
 Source1:      wordpress-apache.conf
 Source2:      wordpress-setup.sh
-Source3:      rc.wordpress
+Source3:      wordpress-cron.sh
+Source4:      rc.wordpress
 Patch0:       wordpress.patch
 
 #   build information
@@ -47,7 +48,7 @@ Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20060823
 PreReq:       OpenPKG, openpkg >= 20060823
-PreReq:       apache
+PreReq:       apache, wget
 PreReq:       apache::with_mod_php = yes
 PreReq:       apache::with_mod_php_mysql = yes
 PreReq:       apache::with_mod_php_pcre = yes
@@ -105,6 +106,10 @@ AutoReqProv:  no
     %{l_shtool} install -c -m 755 %{l_value -s -a} \
         %{SOURCE wordpress-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/wordpress-setup
 
+    #   install cron-job script
+    %{l_shtool} install -c -m 755 %{l_value -s -a} \
+        %{SOURCE wordpress-cron.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/wordpress-cron
+
     #   install custom Apache configuration
     l_hostname=`%{l_shtool} echo -e %h`
     l_domainname=`%{l_shtool} echo -e %d | cut -c2-`