summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/services.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index f22e646..194b4f3 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -2363,6 +2363,7 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont
global $config, $g;
$is_installed = false;
+ $cron_changed = true;
if (!is_array($config['cron']))
$config['cron'] = array();
@@ -2391,8 +2392,13 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont
$config['cron']['item'][] = $cron_item;
write_config(sprintf(gettext("Installed cron job for %s"), $command));
} else {
- $config['cron']['item'][$x] = $cron_item;
- write_config(sprintf(gettext("Updated cron job for %s"), $command));
+ if ($config['cron']['item'][$x] == $cron_item) {
+ $cron_changed = false;
+ log_error(sprintf(gettext("Checked cron job for %s, no change needed"), $command));
+ } else {
+ $config['cron']['item'][$x] = $cron_item;
+ write_config(sprintf(gettext("Updated cron job for %s"), $command));
+ }
}
} else {
if($is_installed == true) {
@@ -2400,7 +2406,9 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont
write_config(sprintf(gettext("Removed cron job for %s"), $command));
}
}
- configure_cron();
+
+ if ($cron_changed)
+ configure_cron();
}
?>
OpenPOWER on IntegriCloud