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
7b07e6a5
Commit
7b07e6a5
authored
Nov 14, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugins: introduce $verbose for plugins #1256
parent
f16199ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
plugins.inc
src/etc/inc/plugins.inc
+2
-2
miniupnpd.inc
src/etc/inc/plugins.inc.d/miniupnpd.inc
+17
-15
rc.bootup
src/etc/rc.bootup
+1
-1
No files found.
src/etc/inc/plugins.inc
View file @
7b07e6a5
...
...
@@ -162,7 +162,7 @@ function plugins_firewall($fw)
return
$fw
;
}
function
plugins_configure
()
function
plugins_configure
(
$verbose
=
true
)
{
foreach
(
plugins_scan
()
as
$name
=>
$path
)
{
require_once
$path
;
...
...
@@ -170,7 +170,7 @@ function plugins_configure()
if
(
function_exists
(
$func
))
{
$workers
=
$func
();
foreach
(
$workers
as
$worker
)
{
$worker
();
$worker
(
$verbose
);
}
}
}
...
...
src/etc/inc/plugins.inc.d/miniupnpd.inc
View file @
7b07e6a5
...
...
@@ -83,17 +83,6 @@ function miniupnpd_configure()
return
array
(
'miniupnpd_configure_do'
);
}
function
miniupnpd_configure_do
()
{
if
(
!
miniupnpd_enabled
())
{
return
;
}
echo
"Starting UPnP service..."
;
miniupnpd_sync_package
();
echo
"done.
\n
"
;
}
function
miniupnpd_uuid
()
{
/* md5 hash of wan mac */
...
...
@@ -102,21 +91,30 @@ function miniupnpd_uuid()
return
substr
(
$uuid
,
0
,
8
)
.
'-'
.
substr
(
$uuid
,
9
,
4
)
.
'-'
.
substr
(
$uuid
,
13
,
4
)
.
'-'
.
substr
(
$uuid
,
17
,
4
)
.
'-'
.
substr
(
$uuid
,
21
,
12
);
}
function
miniupnpd_
sync_package
(
)
function
miniupnpd_
configure_do
(
$verbose
=
false
)
{
global
$config
;
global
$input_errors
;
if
(
!
miniupnpd_enabled
())
{
return
;
}
if
(
$verbose
)
{
echo
'Starting UPnP service...'
;
flush
();
}
$upnp_config
=
$config
[
'installedpackages'
][
'miniupnpd'
][
'config'
][
0
];
$config_file
=
'/var/etc/miniupnpd.conf'
;
$ext_ifname
=
get_real_interface
(
$upnp_config
[
'ext_iface'
]);
if
(
$ext_ifname
==
$upnp_config
[
'ext_iface'
])
{
log_error
(
"miniupnpd: Could not resolve real interface for
{
$upnp_config
[
'ext_iface'
]
}
, exit"
);
if
(
$verbose
)
{
echo
"failed.
\n
"
;
}
return
;
}
$config_text
=
"ext_ifname=
{
$ext_ifname
}
\n
"
;
$config_text
.=
"port=2189
\n
"
;
...
...
@@ -234,4 +232,8 @@ function miniupnpd_sync_package()
@
unlink
(
$config_file
);
}
}
if
(
$verbose
)
{
echo
"done.
\n
"
;
}
}
src/etc/rc.bootup
View file @
7b07e6a5
...
...
@@ -193,7 +193,7 @@ filter_configure_sync(true);
/* Run all registered plugins */
if
(
function_exists
(
'plugins_configure'
))
{
plugins_configure
();
plugins_configure
(
true
);
}
/* start IPsec tunnels */
...
...
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