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
fd987e63
Commit
fd987e63
authored
Nov 20, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntpd: it's a plugin!
parent
4a6a53bc
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
443 additions
and
372 deletions
+443
-372
ntpd.inc
src/etc/inc/plugins.inc.d/ntpd.inc
+431
-0
services.inc
src/etc/inc/services.inc
+0
-10
system.inc
src/etc/inc/system.inc
+0
-349
rc.bootup
src/etc/rc.bootup
+0
-1
rc.newwanip
src/etc/rc.newwanip
+0
-3
rc.newwanipv6
src/etc/rc.newwanipv6
+2
-4
rc.reload_all
src/etc/rc.reload_all
+4
-1
services_ntpd.php
src/www/services_ntpd.php
+2
-1
services_ntpd_gps.php
src/www/services_ntpd_gps.php
+2
-1
services_ntpd_pps.php
src/www/services_ntpd_pps.php
+2
-2
No files found.
src/etc/inc/plugins.inc.d/ntpd.inc
0 → 100644
View file @
fd987e63
This diff is collapsed.
Click to expand it.
src/etc/inc/services.inc
View file @
fd987e63
...
...
@@ -1858,16 +1858,6 @@ function services_get()
$services
[]
=
$pconfig
;
}
if
(
isset
(
$config
[
'system'
][
'timeservers'
]))
{
$pconfig
=
array
();
$pconfig
[
'name'
]
=
"ntpd"
;
$pconfig
[
'description'
]
=
gettext
(
"NTP clock sync"
);
$pconfig
[
'php'
][
'restart'
]
=
array
(
'system_ntp_configure'
);
$pconfig
[
'php'
][
'start'
]
=
array
(
'system_ntp_configure'
);
$pconfig
[
'pidfile'
]
=
'/var/run/ntpd.pid'
;
$services
[]
=
$pconfig
;
}
if
(
isset
(
$config
[
'dhcrelay'
][
'enable'
]))
{
$pconfig
=
array
();
$pconfig
[
'name'
]
=
"dhcrelay"
;
...
...
src/etc/inc/system.inc
View file @
fd987e63
This diff is collapsed.
Click to expand it.
src/etc/rc.bootup
View file @
fd987e63
...
...
@@ -179,7 +179,6 @@ system_routing_configure();
system_routing_enable
();
dnsmasq_configure_do
(
true
);
unbound_configure_do
(
true
);
system_ntp_configure
(
false
,
true
);
services_dhcpd_configure
(
'all'
,
array
(),
true
);
services_dhcpleases_configure
();
services_dhcrelay_configure
(
true
);
...
...
src/etc/rc.newwanip
View file @
fd987e63
...
...
@@ -215,9 +215,6 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface
if
(
function_exists
(
'plugins_configure'
))
{
plugins_configure
(
'interface'
);
}
/* reconfigure ntpd */
system_ntp_configure
(
false
);
}
/* reload filter, don't try to sync to carp slave */
...
...
src/etc/rc.newwanipv6
View file @
fd987e63
...
...
@@ -152,8 +152,9 @@ if (ipsec_configured_on_interface($interface)) {
}
/* start OpenVPN server & clients */
if
(
substr
(
$interface_real
,
0
,
4
)
!=
"ovpn"
)
if
(
substr
(
$interface_real
,
0
,
4
)
!=
'ovpn'
)
{
openvpn_resync_all
(
$interface
);
}
/* reload graphing functions */
enable_rrd_graphing
();
...
...
@@ -162,6 +163,3 @@ enable_rrd_graphing();
if
(
function_exists
(
'plugins_configure'
))
{
plugins_configure
(
'interface'
);
}
/* reconfigure ntpd */
system_ntp_configure
(
false
);
src/etc/rc.reload_all
View file @
fd987e63
...
...
@@ -54,9 +54,12 @@ system_routing_enable();
interfaces_configure
();
services_dyndns_configure
();
system_cron_configure
();
system_ntp_configure
();
mwexec_bg
(
'/usr/local/etc/rc.sshd'
);
mwexec_bg
(
'/usr/local/etc/rc.restart_webgui'
);
if
(
function_exists
(
'plugins_configure'
))
{
plugins_configure
(
'local'
);
}
log_error
(
"rc.reload_all: Reloading filter configuration."
);
filter_configure_sync
();
src/www/services_ntpd.php
View file @
fd987e63
...
...
@@ -33,6 +33,7 @@ require_once("rrd.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"plugins.inc.d/ntpd.inc"
);
if
(
!
isset
(
$config
[
'ntpd'
])
||
!
is_array
(
$config
[
'ntpd'
]))
{
$config
[
'ntpd'
]
=
array
();
...
...
@@ -113,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$a_ntpd
[
'leapsec'
]
=
base64_encode
(
file_get_contents
(
$_FILES
[
'leapfile'
][
'tmp_name'
]));
}
write_config
(
"Updated NTP Server Settings"
);
system_ntp_configure
();
ntpd_configure_start
();
header
(
url_safe
(
'Location: /services_ntpd.php'
));
exit
;
}
...
...
src/www/services_ntpd_gps.php
View file @
fd987e63
...
...
@@ -32,6 +32,7 @@ require_once("guiconfig.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"plugins.inc.d/ntpd.inc"
);
if
(
!
isset
(
$config
[
'ntpd'
][
'gps'
]))
{
$config
[
'ntpd'
][
'gps'
]
=
array
();
...
...
@@ -67,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$gps
[
'initcmd'
]
=
base64_encode
(
$gps
[
'initcmd'
]);
$config
[
'ntpd'
][
'gps'
]
=
$gps
;
write_config
(
"Updated NTP GPS Settings"
);
system_ntp_configure
();
ntpd_configure_start
();
header
(
url_safe
(
'Location: /services_ntpd_gps.php'
));
exit
;
}
...
...
src/www/services_ntpd_pps.php
View file @
fd987e63
...
...
@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"plugins.inc.d/ntpd.inc"
);
if
(
!
isset
(
$config
[
'ntpd'
])
||
!
is_array
(
$config
[
'ntpd'
]))
{
$config
[
'ntpd'
]
=
array
();
...
...
@@ -39,7 +40,6 @@ if (!isset($config['ntpd']['pps'])) {
$config
[
'ntpd'
][
'pps'
]
=
array
();
}
$copy_fields
=
array
(
'port'
,
'fudge1'
,
'stratum'
,
'flag2'
,
'flag3'
,
'flag4'
,
'refid'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
=
array
();
...
...
@@ -66,7 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$config
[
'ntpd'
][
'pps'
]
=
$pps
;
write_config
(
"Updated NTP PPS Settings"
);
system_ntp_configure
();
ntpd_configure_start
();
header
(
url_safe
(
'Location: /services_ntpd_pps.php'
));
exit
;
}
...
...
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