aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wagner <tripolar@gmx.at>2018-01-02 15:16:48 +0100
committerPeter Wagner <tripolar@gmx.at>2018-01-02 15:19:23 +0100
commit04654291a4899bc69e2e8aca1bd4af9db0ed22aa (patch)
treee74f5118fcbfa3f2fab9ba19be1c70f4c25c11be
parent4e2336c5f45f01c92d4a595b3a26b174ec14eeb1 (diff)
ntpd: *mimic the behaviour of the busybox ntpd's "-S" flag
*create a seperate line for every server, otherwise only the first listed server will be used
3 files changed, 10 insertions, 5 deletions
diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile
index ad3b5e715..aafcb1223 100644
--- a/net/ntpd/Makefile
+++ b/net/ntpd/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ntp
PKG_VERSION:=4.2.8p10
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
diff --git a/net/ntpd/files/ntpd.hotplug-helper b/net/ntpd/files/ntpd.hotplug-helper
index 555825c64..eacf4c55d 100644
--- a/net/ntpd/files/ntpd.hotplug-helper
+++ b/net/ntpd/files/ntpd.hotplug-helper
@@ -1,13 +1,15 @@
#!/bin/sh
+SLEEPTIME=10
+
while true
do
STATUS="$(/usr/sbin/ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')"
- if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ]
+ if [[ -n "$STATUS" && "$STATUS" -lt "16" ]]
then
ACTION="stratum" /sbin/hotplug-call ntp
- exit 0
+ SLEEPTIME=660
fi
- sleep 10
+ sleep $SLEEPTIME
done
diff --git a/net/ntpd/files/ntpd.init b/net/ntpd/files/ntpd.init
index 0ed663750..0aaf132a4 100644
--- a/net/ntpd/files/ntpd.init
+++ b/net/ntpd/files/ntpd.init
@@ -68,7 +68,10 @@ start_service() {
emit ""
fi
- emit "server $server iburst"
+ for i in $server
+ do
+ emit "server $i iburst"
+ done
mkdir -p /var/lib/ntp
chown -R ntp:ntp /var/lib/ntp