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
c1628bbf
Commit
c1628bbf
authored
Nov 13, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
miniupnpd: add enabled helper
parent
78945ce0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
miniupnpd.inc
src/etc/inc/plugins.inc.d/miniupnpd.inc
+28
-22
No files found.
src/etc/inc/plugins.inc.d/miniupnpd.inc
View file @
c1628bbf
...
@@ -26,33 +26,39 @@
...
@@ -26,33 +26,39 @@
POSSIBILITY OF SUCH DAMAGE.
POSSIBILITY OF SUCH DAMAGE.
*/
*/
function
miniupnpd_
firewall
(
$fw
)
function
miniupnpd_
enabled
(
)
{
{
global
$config
;
global
$config
;
if
(
isset
(
$config
[
'installedpackages'
][
'miniupnpd'
][
'config'
][
0
][
'enable'
]))
{
return
isset
(
$config
[
'installedpackages'
][
'miniupnpd'
][
'config'
][
0
][
'enable'
]);
$fw
->
registerAnchor
(
"miniupnpd/*"
,
"rdr"
);
}
$fw
->
registerAnchor
(
"miniupnpd/*"
,
"fw"
);
function
miniupnpd_firewall
(
$fw
)
{
if
(
!
miniupnpd_enabled
())
{
return
;
}
}
$fw
->
registerAnchor
(
'miniupnpd/*'
,
'rdr'
);
$fw
->
registerAnchor
(
'miniupnpd/*'
,
'fw'
);
}
}
function
miniupnpd_services
()
function
miniupnpd_services
()
{
{
global
$config
;
$services
=
array
();
$services
=
array
();
if
(
isset
(
$config
[
'installedpackages'
][
'miniupnpd'
][
'config'
][
0
][
'enable'
]))
{
if
(
!
miniupnpd_enabled
())
{
return
$services
;
}
$pconfig
=
array
();
$pconfig
=
array
();
$pconfig
[
'name'
]
=
"miniupnpd"
;
$pconfig
[
'name'
]
=
'miniupnpd'
;
$pconfig
[
'description'
]
=
gettext
(
"UPnP Service"
);
$pconfig
[
'description'
]
=
gettext
(
'Univeral Plug and Play'
);
$pconfig
[
'description'
]
=
gettext
(
"UPnP Service"
);
$pconfig
[
'php'
][
'restart'
]
=
array
(
'miniupnpd_stop'
,
'miniupnpd_start'
);
$pconfig
[
'php'
][
'restart'
]
=
array
(
'miniupnpd_stop'
,
'miniupnpd_start'
);
$pconfig
[
'php'
][
'start'
]
=
array
(
'miniupnpd_start'
);
$pconfig
[
'php'
][
'start'
]
=
array
(
'miniupnpd_start'
);
$pconfig
[
'php'
][
'stop'
]
=
array
(
'miniupnpd_stop'
);
$pconfig
[
'php'
][
'stop'
]
=
array
(
'miniupnpd_stop'
);
$pconfig
[
'pidfile'
]
=
'/var/run/miniupnpd.pid'
;
$pconfig
[
'pidfile'
]
=
'/var/run/miniupnpd.pid'
;
$services
[]
=
$pconfig
;
$services
[]
=
$pconfig
;
}
return
$services
;
return
$services
;
}
}
...
@@ -79,13 +85,13 @@ function miniupnpd_configure()
...
@@ -79,13 +85,13 @@ function miniupnpd_configure()
function
miniupnpd_configure_do
()
function
miniupnpd_configure_do
()
{
{
global
$config
;
if
(
!
miniupnpd_enabled
())
{
return
;
}
if
(
!
empty
(
$config
[
'installedpackages'
][
'miniupnpd'
][
'config'
][
0
][
'enable'
]))
{
echo
"Starting UPnP service..."
;
echo
gettext
(
"Starting UPnP service... "
);
miniupnpd_sync_package
();
miniupnpd_sync_package
();
echo
"done.
\n
"
;
echo
"done.
\n
"
;
}
}
}
function
miniupnpd_uuid
()
function
miniupnpd_uuid
()
...
...
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