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
4346d549
Commit
4346d549
authored
Dec 09, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: $verbose conversion for OpenVPN
parent
c1bd0196
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
openvpn.inc
src/etc/inc/openvpn.inc
+19
-3
rc.bootup
src/etc/rc.bootup
+5
-10
No files found.
src/etc/inc/openvpn.inc
View file @
4346d549
...
...
@@ -1026,7 +1026,7 @@ function openvpn_resync_csc()
}
}
function
openvpn_prepare_all
()
function
openvpn_prepare_all
(
$verbose
=
false
)
{
global
$config
;
...
...
@@ -1034,7 +1034,10 @@ function openvpn_prepare_all()
return
;
}
log_error
(
'Creating OpenVPN instances.'
);
if
(
$verbose
)
{
echo
'Creating OpenVPN instances...'
;
flush
();
}
foreach
(
array
(
'server'
,
'client'
)
as
$mode
)
{
if
(
isset
(
$config
[
'openvpn'
][
"openvpn-
{
$mode
}
"
]))
{
...
...
@@ -1043,6 +1046,10 @@ function openvpn_prepare_all()
}
}
}
if
(
$verbose
)
{
echo
"done.
\n
"
;
}
}
function
openvpn_resync
(
$mode
,
$settings
)
...
...
@@ -1051,7 +1058,7 @@ function openvpn_resync($mode, $settings)
openvpn_restart
(
$mode
,
$settings
);
}
function
openvpn_resync_all
(
$interface
=
null
)
function
openvpn_resync_all
(
$interface
=
null
,
$verbose
=
false
)
{
global
$config
;
...
...
@@ -1061,6 +1068,11 @@ function openvpn_resync_all($interface = null)
return
;
}
if
(
$verbose
)
{
echo
'Syncing OpenVPN settings...'
;
flush
();
}
if
(
!
empty
(
$interface
))
{
log_error
(
sprintf
(
'Resyncing OpenVPN instances for interface %s.'
,
...
...
@@ -1081,6 +1093,10 @@ function openvpn_resync_all($interface = null)
}
openvpn_resync_csc
();
if
(
$verbose
)
{
echo
"done.
\n
"
;
}
}
function
openvpn_get_active_servers
(
$type
=
'multipoint'
)
...
...
src/etc/rc.bootup
View file @
4346d549
...
...
@@ -104,16 +104,11 @@ system_hosts_generate(true);
interfaces_loopback_configure
(
true
);
system_syslogd_start
(
true
);
/* set up interfaces */
system_console_mute
();
openvpn_prepare_all
();
interfaces_configure
();
system_console_unmute
();
/* start OpenVPN server & clients */
echo
"Syncing OpenVPN settings..."
;
openvpn_resync_all
();
echo
"done.
\n
"
;
system_console_mute
();
/* XXX move this further up */
openvpn_prepare_all
(
true
);
interfaces_configure
();
/* XXX needs $verbose conversion */
openvpn_resync_all
(
null
,
true
);
system_console_unmute
();
/* XXX move this further down */
system_resolvconf_generate
(
true
);
filter_configure_sync
(
true
);
...
...
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