summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-04-29 16:00:28 -0300
committerRenato Botelho <renato@netgate.com>2016-04-29 16:00:28 -0300
commit17b31252fa105f473ac4c77fc200baf9dcb5f51b (patch)
treeb49807a3da6e315e4618c810930bdaa3e2ff7bc5
parent85a96e14b72c5526f83635f3a86176853171033c (diff)
downloadpfsense-17b31252fa105f473ac4c77fc200baf9dcb5f51b.zip
pfsense-17b31252fa105f473ac4c77fc200baf9dcb5f51b.tar.gz
Test for internet connection 3 times trying to reinstall packages after upgrade or config restore. Fixes #6180
-rw-r--r--src/etc/inc/pkg-utils.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc
index 7ea584f..e5edf43 100644
--- a/src/etc/inc/pkg-utils.inc
+++ b/src/etc/inc/pkg-utils.inc
@@ -980,14 +980,22 @@ function package_reinstall_all() {
/* During boot after upgrade, wait for internet connection */
if ($upgrade) {
update_status(gettext("Waiting for internet connection to update pkg metadata and finish package reinstallation"));
- while (true) {
+ $ntries = 3;
+ while ($ntries > 0) {
if (pkg_update(true)) {
break;
}
update_status('.');
sleep(1);
+ $ntries--;
}
update_status("\n");
+
+ if ($ntries == 0) {
+ file_notice(gettext("Package reinstall"),
+ gettext("Package reinstall process was ABORTED due to lack of internet connectivity"));
+ return false;
+ }
}
$pkg_info = get_pkg_info();
OpenPOWER on IntegriCloud