ntpdate: use uci configured servers instead of static list
authorKarl Palsson <redacted>
Tue, 18 Dec 2018 14:49:13 +0000 (14:49 +0000)
committerKarl Palsson <redacted>
Tue, 2 Jul 2019 09:25:34 +0000 (09:25 +0000)
If we're going to have a list of ntp servers, we should at least respect
them.  Fallback to the original static list if no configured servers are
found.

Signed-off-by: Karl Palsson <redacted>
net/ntpd/Makefile
net/ntpd/files/ntpdate.init

index e98924a7ae8387c8e7e067be20b52e5d1246baa0..d1f7d5d7bda488a29f22f26410a926e89c423751 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntp
 PKG_VERSION:=4.2.8p13
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
index 2f332104d2437c5ec442a32e4dce228bee0d43a3..30460e5ae3b14905bdbf56c40f8f1940413ead7c 100644 (file)
@@ -3,7 +3,9 @@
 
 START=60
 
-STEP_SERVERS="0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org"
+DEFAULT_SERVERS="0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org"
+CFG_SERVERS=$(uci -q get system.ntp.server)
+STEP_SERVERS=${CFG_SERVERS:-$DEFAULT_SERVERS}
 TIMEOUT="2" # in seconds
 
 start() {
git clone https://git.99rst.org/PROJECT