Project

General

Profile

« Previous | Next » 

Revision dea792c2

Added by Steve Beaver about 7 years ago

Fixed #8519
Added simple test to ensure the instance of pfSense-upgrade is the instance started by hte upgrade GUI page, not some other process

View differences:

src/usr/local/www/pkg_mgr_install.php
63 63
$repos = pkg_list_repos();
64 64

  
65 65
$pkgname = '';
66

  
66 67
if (!empty($_REQUEST['pkg'])) {
67 68
	$pkgname = $_REQUEST['pkg'];
68 69
}
......
525 526

  
526 527
if ($confirmed && !$completed) {
527 528
	/* Write out configuration to create a backup prior to pkg install. */
528
	write_config(gettext("Creating restore point before package installation."));
529
	if ($firmwareupdate) {
530
		write_config(gettext("Creating restore point before upgrade."));
531
	} else {
532
		write_config(gettext("Creating restore point before package installation."));
533
	}
529 534

  
530 535
	$progbar = true;
531 536
	$upgrade_script = "/usr/local/sbin/{$g['product_name']}-upgrade -y -l {$logfilename}.txt -p {$g['tmp_path']}/{$g['product_name']}-upgrade.sock";
......
555 560

  
556 561
		case 'installed':
557 562
		default:
558
			if ($firmwareupdate) {
559
				mwexec_bg("{$upgrade_script}");
560
			} else {
561
				mwexec_bg("{$upgrade_script} -i {$pkgname}");
563
			$rv = 0;
564

  
565
			for ($rv=0, $cnt=0; $cnt < 8; $cnt++) {
566
				if ($firmwareupdate) {
567
					$r = mwexec_bg("{$upgrade_script}");
568
				} else {
569
					$r = mwexec_bg("{$upgrade_script} -i {$pkgname}");
570
				}
571

  
572
				if (($rv != 75) && file_exists("{$g['tmp_path']}/{$g['product_name']}-upgrade.sock")) {
573
					$start_polling = true;
574
					break;
575
				}
576

  
577
				sleep(2);
562 578
			}
563
			$start_polling = true;
579

  
580
			$upgrbusy = ($cnt >= 8);
581

  
564 582
			break;
565 583
	}
566 584
}
......
644 662
	$('#final').show();
645 663
}
646 664

  
647
function get_firmware_versions()
648
{
665
function get_firmware_versions() {
649 666
	var ajaxVersionRequest;
650 667

  
651 668
	// Retrieve the version information
......
815 832
		show_info();
816 833
	}
817 834

  
835
	if ("<?=$upgrbusy?>") {
836
		$('#output').html("THe update system is busy. Please try again later");
837
	}
838

  
818 839
	// If we are just re-drawing the page after a successful install/remove/reinstall,
819 840
	// we only need to re-populate the progress indicator and the status banner
820 841
	if ("<?=$completed?>") {

Also available in: Unified diff