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
09173813
Commit
09173813
authored
Mar 19, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: shrink usage of kld* utilities further
parent
3f780856
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
10 deletions
+5
-10
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+4
-4
util.inc
src/etc/inc/util.inc
+0
-5
status.php
src/www/status.php
+1
-1
No files found.
src/etc/inc/pfsense-utils.inc
View file @
09173813
...
@@ -379,9 +379,9 @@ function load_crypto_module()
...
@@ -379,9 +379,9 @@ function load_crypto_module()
{
{
global
$config
;
global
$config
;
if
(
!
empty
(
$config
[
'system'
][
'crypto_hardware'
])
&&
!
is_module_loaded
(
$config
[
'system'
][
'crypto_hardware'
])
)
{
if
(
!
empty
(
$config
[
'system'
][
'crypto_hardware'
]))
{
log_error
(
sprintf
(
gettext
(
'Loading %s cryptographic accelerator module.'
),
$config
[
'system'
][
'crypto_hardware'
]));
log_error
(
sprintf
(
gettext
(
'Loading %s cryptographic accelerator module.'
),
$config
[
'system'
][
'crypto_hardware'
]));
mwexecf
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'crypto_hardware'
]);
mwexecf
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'crypto_hardware'
]
,
true
);
}
}
if
(
isset
(
$config
[
'system'
][
'cryptodev_enable'
]))
{
if
(
isset
(
$config
[
'system'
][
'cryptodev_enable'
]))
{
...
@@ -395,9 +395,9 @@ function load_thermal_module()
...
@@ -395,9 +395,9 @@ function load_thermal_module()
{
{
global
$config
;
global
$config
;
if
(
!
empty
(
$config
[
'system'
][
'thermal_hardware'
])
&&
!
is_module_loaded
(
$config
[
'system'
][
'thermal_hardware'
])
)
{
if
(
!
empty
(
$config
[
'system'
][
'thermal_hardware'
]))
{
log_error
(
sprintf
(
gettext
(
'Loading %s thermal monitor module.'
),
$config
[
'system'
][
'thermal_hardware'
]));
log_error
(
sprintf
(
gettext
(
'Loading %s thermal monitor module.'
),
$config
[
'system'
][
'thermal_hardware'
]));
mwexecf
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'thermal_hardware'
]);
mwexecf
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'thermal_hardware'
]
,
true
);
}
}
}
}
...
...
src/etc/inc/util.inc
View file @
09173813
...
@@ -116,11 +116,6 @@ function unlock($cfglckkey = null)
...
@@ -116,11 +116,6 @@ function unlock($cfglckkey = null)
}
}
}
}
function
is_module_loaded
(
$module_name
)
{
return
!
mwexecf
(
'/sbin/kldstat -qn %s'
,
$module_name
,
true
);
}
/* validate non-negative numeric string, or equivalent numeric variable */
/* validate non-negative numeric string, or equivalent numeric variable */
function
is_numericint
(
$arg
)
{
function
is_numericint
(
$arg
)
{
return
(((
is_int
(
$arg
)
&&
$arg
>=
0
)
||
(
is_string
(
$arg
)
&&
strlen
(
$arg
)
>
0
&&
ctype_digit
(
$arg
)))
?
true
:
false
);
return
(((
is_int
(
$arg
)
&&
$arg
>=
0
)
||
(
is_string
(
$arg
)
&&
strlen
(
$arg
)
>
0
&&
ctype_digit
(
$arg
)))
?
true
:
false
);
...
...
src/www/status.php
View file @
09173813
...
@@ -116,7 +116,7 @@ defCmdT("top | head -n5", "/usr/bin/top | /usr/bin/head -n5");
...
@@ -116,7 +116,7 @@ defCmdT("top | head -n5", "/usr/bin/top | /usr/bin/head -n5");
defCmdT
(
"sysctl hw.physmem"
,
"/sbin/sysctl hw.physmem"
);
defCmdT
(
"sysctl hw.physmem"
,
"/sbin/sysctl hw.physmem"
);
if
(
is_module_loaded
(
'ipfw'
))
{
if
(
!
mwexecf
(
'/sbin/kldstat -qn %s'
,
'ipfw'
,
true
))
{
defCmdT
(
'ipfw queue show'
,
'/sbin/ipfw queue show'
);
defCmdT
(
'ipfw queue show'
,
'/sbin/ipfw queue show'
);
defCmdT
(
'ipfw pipe show'
,
'/sbin/ipfw pipe show'
);
defCmdT
(
'ipfw pipe show'
,
'/sbin/ipfw pipe show'
);
defCmdT
(
'ipfw show'
,
'/sbin/ipfw show'
);
defCmdT
(
'ipfw show'
,
'/sbin/ipfw show'
);
...
...
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