Skip to content

Commit b2c24d2

Browse files
authored
If cron command has arg, dpn
1 parent d783635 commit b2c24d2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: cron-lib.pl

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ sub setup_cron_script
2929
&foreign_require("cron");
3030
&foreign_require("webmincron");
3131
local $cronjob = &find_module_cron_job($job->{'command'});
32-
if ($job->{'command'} =~ /\Q$module_config_directory\E\/([^ \|\&><;]+)/) {
32+
if ($job->{'command'} =~ /(\Q$module_config_directory\E\/([^ \|\&><;]+))/) {
3333
# Run from this module
34-
local $script = $1;
35-
&cron::create_wrapper($job->{'command'}, $module_name,
34+
local ($wrapper, $script) = ($1, $2);
35+
&cron::create_wrapper($wrapper, $module_name,
3636
$script);
3737

3838
# Find existing classic cron job, and remove it
@@ -77,9 +77,9 @@ sub setup_cron_script
7777
# Some other random job .. just use normal cron
7878
if (!$cronjob) {
7979
if ($job->{'command'} =~
80-
/\Q$config_directory\E\/([^\/]+)\/([^ \|\&><;]+)/) {
81-
local ($m, $s) = ($1, $2);
82-
&cron::create_wrapper($job->{'command'}, $m, $s);
80+
/(\Q$config_directory\E\/([^\/]+)\/([^ \|\&><;]+))/) {
81+
local ($wrapper, $m, $s) = ($1, $2, $3);
82+
&cron::create_wrapper($wrapper, $m, $s);
8383
}
8484
&lock_file(&cron::cron_file($job));
8585
&cron::create_cron_job($job);

0 commit comments

Comments
 (0)