Commit 9346e898 authored by Franco Fichtner's avatar Franco Fichtner

config: another factory reset follow-up #124

parent 15016f4d
......@@ -198,10 +198,8 @@ function write_config($desc = 'Unknown', $backup = true)
* RESULT
* integer - indicates completion
******/
function reset_factory_defaults()
function reset_factory_defaults($sync = true)
{
$lockkey = lock('config', LOCK_EX);
/* create conf directory, if necessary */
@mkdir('/conf');
......@@ -219,12 +217,15 @@ function reset_factory_defaults()
/* call the wizard */
touch('/conf/trigger_initial_wizard');
unlock($lockkey);
setup_serial_port();
/* as we go through a special case directly reboot */
mwexec('/sbin/shutdown -or now');
$shutdown_cmd = '/sbin/shutdown -or now';
if ($sync) {
mwexec($shutdown_cmd);
} else {
mwexec_bg($shutdown_cmd);
}
}
function config_restore($conffile) {
......
<?php
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2004-2009 Scott Ullrich
......@@ -48,8 +49,7 @@ include("head.inc");
print_info_box(gettext("The system has been reset to factory defaults and is now rebooting. This may take a few minutes, depending on your hardware.")); ?>
<pre>
<?php
reset_factory_defaults();
system_reboot();
reset_factory_defaults(false);
?>
</pre>
<?php else: ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment