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
5ce466bf
Commit
5ce466bf
authored
Jul 06, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: embed otherwise unused is_serial_enabled()
parent
a8fe03e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+6
-10
No files found.
src/etc/inc/pfsense-utils.inc
View file @
5ce466bf
...
@@ -667,6 +667,9 @@ function reload_all_sync()
...
@@ -667,6 +667,9 @@ function reload_all_sync()
function
setup_serial_port
(
$when
=
'save'
,
$path
=
''
)
function
setup_serial_port
(
$when
=
'save'
,
$path
=
''
)
{
{
global
$config
;
global
$config
;
$serial_enabled
=
isset
(
$config
[
'system'
][
'enableserial'
]);
$prefix
=
""
;
$prefix
=
""
;
if
((
$when
==
"upgrade"
)
&&
(
!
empty
(
$path
))
&&
is_dir
(
$path
.
'/boot/'
))
if
((
$when
==
"upgrade"
)
&&
(
!
empty
(
$path
))
&&
is_dir
(
$path
.
'/boot/'
))
$prefix
=
"/tmp/
{
$path
}
"
;
$prefix
=
"/tmp/
{
$path
}
"
;
...
@@ -691,7 +694,7 @@ function setup_serial_port($when = 'save', $path = '')
...
@@ -691,7 +694,7 @@ function setup_serial_port($when = 'save', $path = '')
fwrite
(
$fd
,
"
{
$bcs
}
\n
"
);
fwrite
(
$fd
,
"
{
$bcs
}
\n
"
);
}
}
}
}
if
(
is_serial_enabled
()
)
{
if
(
$serial_enabled
)
{
fwrite
(
$fd
,
"-S
{
$serialspeed
}
-D
\n
"
);
fwrite
(
$fd
,
"-S
{
$serialspeed
}
-D
\n
"
);
}
}
fclose
(
$fd
);
fclose
(
$fd
);
...
@@ -715,7 +718,7 @@ function setup_serial_port($when = 'save', $path = '')
...
@@ -715,7 +718,7 @@ function setup_serial_port($when = 'save', $path = '')
&&
(
stripos
(
$bcs
,
"autoboot_delay"
)
===
false
))
&&
(
stripos
(
$bcs
,
"autoboot_delay"
)
===
false
))
$new_boot_config
[]
=
$bcs
;
$new_boot_config
[]
=
$bcs
;
if
(
is_serial_enabled
()
)
{
if
(
$serial_enabled
)
{
$new_boot_config
[]
=
'boot_multicons="YES"'
;
$new_boot_config
[]
=
'boot_multicons="YES"'
;
$new_boot_config
[]
=
'boot_serial="YES"'
;
$new_boot_config
[]
=
'boot_serial="YES"'
;
$primaryconsole
=
$config
[
'system'
][
'primaryconsole'
];
$primaryconsole
=
$config
[
'system'
][
'primaryconsole'
];
...
@@ -739,7 +742,7 @@ function setup_serial_port($when = 'save', $path = '')
...
@@ -739,7 +742,7 @@ function setup_serial_port($when = 'save', $path = '')
$ttys_split
=
explode
(
"
\n
"
,
$ttys
);
$ttys_split
=
explode
(
"
\n
"
,
$ttys
);
$fd
=
fopen
(
"/etc/ttys"
,
"w"
);
$fd
=
fopen
(
"/etc/ttys"
,
"w"
);
$on_off
=
(
is_serial_enabled
()
?
'on'
:
'off'
)
;
$on_off
=
$serial_enabled
?
'on'
:
'off'
;
if
(
isset
(
$config
[
'system'
][
'disableconsolemenu'
]))
{
if
(
isset
(
$config
[
'system'
][
'disableconsolemenu'
]))
{
$console_type
=
'Pc'
;
$console_type
=
'Pc'
;
...
@@ -761,13 +764,6 @@ function setup_serial_port($when = 'save', $path = '')
...
@@ -761,13 +764,6 @@ function setup_serial_port($when = 'save', $path = '')
reload_ttys
();
reload_ttys
();
}
}
function
is_serial_enabled
()
{
global
$config
;
return
isset
(
$config
[
'system'
][
'enableserial'
]);
}
function
reload_ttys
()
function
reload_ttys
()
{
{
/* force init(8) to reload /etc/ttys */
/* force init(8) to reload /etc/ttys */
...
...
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