Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
9346e898
Commit
9346e898
authored
Apr 03, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: another factory reset follow-up #124
parent
15016f4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
config.lib.inc
src/etc/inc/config.lib.inc
+7
-6
diag_defaults.php
src/www/diag_defaults.php
+2
-2
No files found.
src/etc/inc/config.lib.inc
View file @
9346e898
...
...
@@ -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
)
{
...
...
src/www/diag_defaults.php
View file @
9346e898
<?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
:
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment