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
a89d2ce4
Commit
a89d2ce4
authored
Jun 06, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: adjust install mode selection
(cherry picked from commit
17f656da
)
parent
c36010b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
config.console.inc
src/etc/inc/config.console.inc
+2
-2
rc.bootup
src/etc/rc.bootup
+19
-20
No files found.
src/etc/inc/config.console.inc
View file @
a89d2ce4
...
...
@@ -28,7 +28,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
function
timeout
(
$timer
=
9
)
function
timeout
(
$timer
=
7
)
{
while
(
!
isset
(
$key
))
{
if
(
$timer
>=
9
)
{
echo
chr
(
8
)
.
chr
(
8
)
.
(
$timer
==
9
?
chr
(
32
)
:
null
)
.
"
{
$timer
}
"
;
}
...
...
@@ -64,7 +64,7 @@ function set_networking_interfaces_ports($probe = false)
if
(
$probe
)
{
echo
PHP_EOL
.
gettext
(
'Press any key to start the manual interface assignment: '
);
$key
=
timeout
(
7
);
$key
=
timeout
();
if
(
!
isset
(
$key
))
{
$interactive
=
false
;
}
...
...
src/etc/rc.bootup
View file @
a89d2ce4
...
...
@@ -71,46 +71,45 @@ function is_interface_mismatch()
return
$do_assign
;
}
function
rescue_detect_keypress
()
{
$time
out
=
9
;
$time
r
=
7
;
echo
"
\n
"
;
echo
"(I)nstaller will be invoked by default.
\n\n
"
;
echo
"(C)ontinue with LiveCD bootup instead.
\n\n
"
;
echo
"(R)ecovery mode escapes to a root shell.
\n\n
"
;
echo
"Timeout before auto boot continues (seconds):
{
$timeout
}
"
;
echo
"Timeout before auto boot continues (seconds):
"
;
$key
=
null
;
exec
(
"/bin/stty erase "
.
chr
(
8
));
while
(
!
in_array
(
$key
,
array
(
"c"
,
"C"
,
"r"
,
"R"
,
"i"
,
"I"
)))
{
echo
chr
(
8
)
.
"
{
$timeout
}
"
;
`/bin/stty -icanon min 0 time 25`
;
$key
=
trim
(
`KEY=\`dd count=1 2>/dev/null\`; echo \$KEY`
);
`/bin/stty icanon`
;
// Decrement our timeout value
$timeout
--
;
// If we have reached 0 exit and continue on
if
(
$timeout
==
0
)
{
while
(
!
isset
(
$key
)
||
!
in_array
(
$key
,
array
(
'c'
,
'C'
,
'r'
,
'R'
,
'i'
,
'I'
)))
{
if
(
$timer
>=
9
)
{
echo
chr
(
8
)
.
chr
(
8
)
.
(
$timer
==
9
?
chr
(
32
)
:
null
)
.
"
{
$timer
}
"
;
}
else
{
echo
chr
(
8
)
.
"
{
$timer
}
"
;
}
shell_exec
(
'/bin/stty -icanon min 0 time 25'
);
$key
=
shell_exec
(
'/bin/dd count=1 status=none'
);
shell_exec
(
'/bin/stty icanon'
);
if
(
$key
==
''
)
{
unset
(
$key
);
}
$timer
--
;
if
(
$timer
==
0
)
{
break
;
}
}
echo
"
\n\n
"
;
if
(
in_array
(
$key
,
array
(
"r"
,
"R"
)))
{
if
(
in_array
(
$key
,
array
(
'r'
,
'R'
)))
{
echo
"Recovery shell selected...
\n\n
"
;
touch
(
"/tmp/donotbootup"
);
touch
(
'/tmp/donotbootup'
);
exit
;
}
elseif
(
in_array
(
$key
,
array
(
"c"
,
"C"
)))
{
}
elseif
(
in_array
(
$key
,
array
(
'c'
,
'C'
)))
{
/* nothing */
}
else
{
echo
"Installer mode selected...
\n
"
;
passthru
(
"/usr/local/etc/rc.installer"
);
if
(
file_exists
(
"/tmp/install_complete"
))
{
passthru
(
"/usr/local/etc/rc.reboot"
);
passthru
(
'/usr/local/etc/rc.installer'
);
if
(
file_exists
(
'/tmp/install_complete'
))
{
passthru
(
'/usr/local/etc/rc.reboot'
);
exit
;
}
}
...
...
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