Projet

Général

Profil

« Précédent | Suivant » 

Révision c11b7ffe

Ajouté par Renato Botelho il y a plus de 9 ans

Remove unbound files, menu and service during config upgrade, otherwise things can go really bad with functions redeclared un base and package unbound.inc and config corrupted when upgrading from 2.1.x with unbound installed to 2.2. PBI and package section are both removed later during package upgrade

Voir les différences:

etc/inc/upgrade_config.inc
3381 3381
	mwexec('/usr/sbin/pw groupadd -n unbound -g 59', true);
3382 3382
	mwexec('/usr/sbin/pw useradd -n unbound -c "Unbound DNS Resolver" -d /var/unbound -s /usr/sbin/nologin -u 59 -g 59', true);
3383 3383

  
3384
	/* cleanup old unbound package stuffs */
3385
	unlink_if_exists("/usr/local/pkg/unbound.xml");
3386
	unlink_if_exists("/usr/local/pkg/unbound.inc");
3387
	unlink_if_exists("/usr/local/pkg/unbound_advanced.xml");
3388
	unlink_if_exists("/usr/local/www/unbound_status.php");
3389
	unlink_if_exists("/usr/local/www/unbound_acls.php");
3390
	unlink_if_exists("/usr/local/bin/unbound_monitor.sh");
3391

  
3392
	/* Remove old menu and service entries */
3393
	if (isset($config['installedpackages']['menu']) && is_array($config['installedpackages']['menu'])) {
3394
		foreach ($config['installedpackages']['menu'] as $idx => $menu) {
3395
			if ($menu['name'] != 'Unbound DNS')
3396
				continue;
3397

  
3398
			unset($config['installedpackages']['menu'][$idx]);
3399
			break;
3400
		}
3401
	}
3402

  
3403
	if (isset($config['installedpackages']['service']) && is_array($config['installedpackages']['service'])) {
3404
		foreach ($config['installedpackages']['service'] as $idx => $service) {
3405
			if ($service['name'] != 'unbound')
3406
				continue;
3407
			unset($config['installedpackages']['service'][$idx]);
3408
			break;
3409
		}
3410
	}
3411

  
3384 3412
	if (!isset($config['installedpackages']['unbound']['config'][0]))
3385 3413
		return;
3386 3414

  

Formats disponibles : Unified diff