summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/config.lib.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-12-21 12:23:19 +0545
committerPhil Davis <phil.davis@inf.org>2015-12-21 12:23:19 +0545
commit7d7da5e5c7aedb11060f0f0906ed0fa8c9a890f8 (patch)
tree86356b19301a5d684cc71434c51012e2fac82710 /src/etc/inc/config.lib.inc
parent240d4f10ac42864181e5260865f620b2cd089639 (diff)
downloadpfsense-7d7da5e5c7aedb11060f0f0906ed0fa8c9a890f8.zip
pfsense-7d7da5e5c7aedb11060f0f0906ed0fa8c9a890f8.tar.gz
Avoid triggering initial wizard before reboot
If you use the the webGUI to reset to factory defaults, then while the existing system is shutting down you navigate off to the dashboard, the initial setup wizard will start. The trigger_initial_wizard flag file is deleted, and so after the reboot the initial setup wizard will not be triggered. This change fixes that sequence of events by using a different flag file across the reboot, and switching it back to the usual flag file name during the subsequent boot up.
Diffstat (limited to 'src/etc/inc/config.lib.inc')
-rw-r--r--src/etc/inc/config.lib.inc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc
index 62763b0..c7e6385 100644
--- a/src/etc/inc/config.lib.inc
+++ b/src/etc/inc/config.lib.inc
@@ -246,7 +246,7 @@ function parse_config_bootup() {
if (strstr($g['platform'], "cdrom")) {
/* try copying the default config. to the floppy */
echo gettext("Resetting factory defaults...") . "\n";
- reset_factory_defaults(true);
+ reset_factory_defaults(true, false);
if (!file_exists("{$g['conf_path']}/config.xml")) {
echo gettext("No XML configuration file found - using factory defaults.\n" .
"Make sure that the configuration floppy disk with the conf/config.xml\n" .
@@ -604,7 +604,7 @@ function write_config($desc="Unknown", $backup = true, $write_config_only = fals
* RESULT
* integer - indicates completion
******/
-function reset_factory_defaults($lock = false) {
+function reset_factory_defaults($lock = false, $reboot_required = true) {
global $g;
conf_mount_rw();
@@ -631,7 +631,12 @@ function reset_factory_defaults($lock = false) {
disable_security_checks();
/* call the wizard */
- touch("/conf/trigger_initial_wizard");
+ if ($reboot_required) {
+ // If we need a reboot first then touch a different trigger file.
+ touch("/conf/trigger_initial_wizard_after_reboot");
+ } else {
+ touch("/conf/trigger_initial_wizard");
+ }
if (!$lock) {
unlock($lockkey);
}
@@ -1019,4 +1024,4 @@ function pfSense_clear_globals() {
register_shutdown_function('pfSense_clear_globals');
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud