Project

General

Profile

« Previous | Next » 

Revision 262f5ebe

Added by Renato Botelho about 8 years ago

Add a workaround to register rc.update_pkg_metadata cronjob on 2.3 since config version cannot be bumped

View differences:

src/etc/rc.bootup
331 331
	system_webgui_start();
332 332
}
333 333

  
334
/* Workaround to add pkg metadata update cronjob on 2.3 */
335
if (!isset($config['cron']['rc_update_pkg_metadata'])) {
336
	$command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata';
337

  
338
	$found = false;
339
	if (is_array($config['cron']['item'])) {
340
		foreach ($config['cron']['item'] as $entry) {
341
			if ($entry['command'] == $command) {
342
				$found = true;
343
				break;
344
			}
345
		}
346
	}
347

  
348
	if (!$found) {
349
		$config['cron']['item'][] = array(
350
			'minute' => '1',
351
			'hour' => '0',
352
			'mday' => '*',
353
			'month' => '*',
354
			'wday' => '*',
355
			'who' => 'root',
356
			'command' => $command
357
		);
358
	}
359

  
360
	$config['cron']['rc_update_pkg_metadata'] = true;
361
	write_config("Registered rc.update_pkg_metadata cronjob");
362
}
363

  
334 364
/* configure cron service */
335 365
echo "Configuring CRON...";
336 366
configure_cron();

Also available in: Unified diff