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
6d7d0bc3
Commit
6d7d0bc3
authored
Feb 21, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vpn: plug pppoe servers into services
parent
3b42ee7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
vpn.inc
src/etc/inc/plugins.inc.d/vpn.inc
+42
-1
No files found.
src/etc/inc/plugins.inc.d/vpn.inc
View file @
6d7d0bc3
...
...
@@ -69,7 +69,23 @@ function vpn_services()
);
}
/* XXX pppoe server instances too */
if
(
isset
(
$config
[
'pppoes'
][
'pppoe'
]))
{
foreach
(
$config
[
'pppoes'
][
'pppoe'
]
as
$pppoecfg
)
{
if
(
isset
(
$pppoecfg
[
'mode'
])
||
$pppoecfg
[
'mode'
]
!=
'off'
)
{
$services
[]
=
array
(
'description'
=>
gettext
(
'PPPoE Server'
)
.
': '
.
htmlspecialchars
(
$pppoecfg
[
'descr'
]),
'php'
=>
array
(
'restart'
=>
array
(
'vpn_pppoe_configure_by_id'
),
'start'
=>
array
(
'vpn_pppoe_configure_by_id'
),
'args'
=>
array
(
'pppoeid'
),
),
'pidfile'
=>
"/var/run/pppoe
{
$pppoecfg
[
'pppoeid'
]
}
-vpn.pid"
,
'pppoeid'
=>
$pppoecfg
[
'pppoeid'
],
'name'
=>
'pppoed'
,
);
}
}
}
return
$services
;
}
...
...
@@ -319,6 +335,31 @@ function vpn_pppoes_configure()
}
}
function
vpn_pppoe_configure_by_id
(
$id
)
{
global
$config
;
$found
=
null
;
if
(
isset
(
$config
[
'pppoes'
][
'pppoe'
]))
{
foreach
(
$config
[
'pppoes'
][
'pppoe'
]
as
$pppoe
)
{
if
(
!
isset
(
$pppoe
[
'mode'
])
||
$pppoe
[
'mode'
]
==
'off'
)
{
continue
;
}
if
(
$id
!=
0
&&
$id
==
$pppoe
[
'pppoeid'
])
{
$found
=
$pppoe
;
break
;
}
}
}
if
(
$found
==
null
)
{
return
;
}
vpn_pppoe_configure
(
$found
);
}
function
vpn_pppoe_configure
(
&
$pppoecfg
)
{
global
$config
;
...
...
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