ntpd: *mimic the behaviour of the busybox ntpd's "-S" flag
authorPeter Wagner <tripolar@gmx.at>
Tue, 2 Jan 2018 14:16:48 +0000 (15:16 +0100)
committerPeter Wagner <tripolar@gmx.at>
Tue, 2 Jan 2018 14:19:23 +0000 (15:19 +0100)
*create a seperate line for every server, otherwise only the first listed server will be used

net/ntpd/Makefile
net/ntpd/files/ntpd.hotplug-helper
net/ntpd/files/ntpd.init

index ad3b5e715ca78d664a34f95a9083654e38b342bb..aafcb12233b0579b99df6c23215af1fadb2d0e82 100644 (file)
@@ -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/
index 555825c64839514e3f15e55e0dc6d995422ed98b..eacf4c55d399c7970e9057d8e62c30c41f38788b 100644 (file)
@@ -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
index 0ed663750a8c25586f29cd84e59d4137b77e47dc..0aaf132a4406a198acd6b981658e5ab71a8a2e1e 100644 (file)
@@ -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