diff options
author | Renato Botelho <renato@netgate.com> | 2017-08-10 14:36:20 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-08-10 17:26:30 -0300 |
commit | c47f209bfc4815e2056fa679f5083297cf292b82 (patch) | |
tree | 2477093cd07b526263656dff2e8f87870fb47906 /src/etc/inc | |
parent | c2e98b94a1ffa6a46090a604e1ee59b6b312aae9 (diff) | |
download | pfsense-c47f209bfc4815e2056fa679f5083297cf292b82.zip pfsense-c47f209bfc4815e2056fa679f5083297cf292b82.tar.gz |
Add a protection to prevent ending up with duplicate crontab entry
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index fbd6d41..34967b2 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -5364,6 +5364,15 @@ function upgrade_167_to_168() { function upgrade_168_to_169() { global $config; + $command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata'; + if (is_array($config['cron']['item'])) { + foreach ($config['cron']['item'] as $entry) { + if ($entry['command'] == $command) { + return; + } + } + } + $config['cron']['item'][] = array( 'minute' => '1', 'hour' => '0', @@ -5371,7 +5380,7 @@ function upgrade_168_to_169() { 'month' => '*', 'wday' => '*', 'who' => 'root', - 'command' => '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata' + 'command' => $command ); } |