Index: hosting.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/hosting/hosting.module,v retrieving revision 1.123 diff -u -r1.123 hosting.module --- hosting.module 25 Oct 2009 01:05:30 -0000 1.123 +++ hosting.module 27 Oct 2009 17:31:05 -0000 @@ -407,27 +407,16 @@ exec('crontab -l 2> /dev/null', $cron); variable_set('hosting_cron_backup', $cron); if (sizeof($cron)) { - foreach ($cron as $line => $entry) { - if (preg_match('/hosting dispatch/', $entry)) { - $pattern = "+(.*)'(.*)/drush.php'(.*)--root='(.*)'.*+"; - $replace = sprintf("$1 '%s' hosting dispatch --root=%s --uri=%s)", - DRUSH_COMMAND, - escapeshellarg(HOSTING_DEFAULT_DOCROOT_PATH), - drush_get_option('uri') - ); - $cron[$line] = preg_replace($pattern, $replace, $entry); - drush_log(dt("Existing hosting dispatch cron entry was found. Replacing")); - $existing = TRUE; - break; - } - } + drush_log("Your existing cron entry will be replaced.", 'warning'); + exec('crontab -r 2> /dev/null'); + $cron = array(); } else { drush_log("message", t("No existing crontab was found")); } - if (!$existing) { - $cron[] = hosting_queues_cron_cmd(); - } + + $cron[] = hosting_queues_cron_cmd(); + $tmpnam = tempnam('hostmaster', 'hm.cron'); $fp = fopen($tmpnam, "w"); foreach ($cron as $line) { @@ -437,6 +426,7 @@ system(sprintf('crontab %s', escapeshellarg($tmpnam))); unlink($tmpnam); drush_log("Notice", t("Installed hosting dispatch cron entry to run every minute")); + return null; } Index: hosting.queues.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/hosting/hosting.queues.inc,v retrieving revision 1.55 diff -u -r1.55 hosting.queues.inc --- hosting.queues.inc 24 Oct 2009 05:54:15 -0000 1.55 +++ hosting.queues.inc 27 Oct 2009 17:31:05 -0000 @@ -195,13 +195,19 @@ escapeshellarg(HOSTING_DEFAULT_DOCROOT_PATH)); if (function_exists('drush_get_option')) { if ($uri = drush_get_option('uri')) { - $cmd .= ' --uri=' . $uri; + $cmd .= ' --uri=' . escapeshellarg($uri); } } return $cmd; } function hosting_queues_cron_cmd() { - return sprintf("*/1 * * * * (%s)", _hosting_dispatch_cmd()); + $command = _hosting_dispatch_cmd(); + $return = <<