Skip to content

Commit

Permalink
chrony: add ability to parse 'maxsources' param
Browse files Browse the repository at this point in the history
description:

[1] https://forum.openwrt.org/t/challenges-with-chrony-additional-parameters/192843

after patching init script, maxsources are visible in
/var/etc/chrony.d/10-uci.conf
example:
pool 0.ca.pool.ntp.org minpoll 7 maxpoll 9 maxsources 2 iburst

Signed-off-by: Peca Nesovanovic <[email protected]>
  • Loading branch information
Npeca75 committed Apr 4, 2024
1 parent b014ae3 commit fce8550
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/chrony/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=chrony
PKG_VERSION:=4.5
PKG_RELEASE:=2
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://chrony-project.org/releases/
Expand Down
4 changes: 3 additions & 1 deletion net/chrony/files/chronyd.init
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ INCLUDEFILE=/var/etc/chrony.d/10-uci.conf
RTCDEVICE=/dev/rtc0

handle_source() {
local cfg=$1 sourcetype=$2 disabled hostname minpoll maxpoll iburst nts
local cfg=$1 sourcetype=$2 disabled hostname minpoll maxpoll maxsources iburst nts

config_get_bool disabled "$cfg" disabled 0
[ "$disabled" = "1" ] && return
Expand All @@ -19,12 +19,14 @@ handle_source() {
[ -z "$hostname" ] && return
config_get minpoll "$cfg" minpoll
config_get maxpoll "$cfg" maxpoll
config_get maxsources "$cfg" maxsources
config_get_bool iburst "$cfg" iburst 0
config_get_bool nts "$cfg" nts 0
echo $(
echo $sourcetype $hostname
[ -n "$minpoll" ] && echo minpoll $minpoll
[ -n "$maxpoll" ] && echo maxpoll $maxpoll
[ -n "$maxsources" ] && echo maxsources $maxsources
[ "$iburst" = "1" ] && echo iburst
[ "$nts" = "1" ] && echo nts
)
Expand Down

0 comments on commit fce8550

Please sign in to comment.