mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
ntpd: add hotplug script that signals when ntp reaches the stratum level like the sysntp implementation
use ntpq to check the status of the ntp server as all other status scripts included in the ntp tarball are based on perl which would dramatically increase the footprint of ntpd Signed-off-by: Peter Wagner <tripolar@gmx.at>
This commit is contained in:
committed by
Jo-Philipp Wich
parent
0f4b5c25b8
commit
84c6db24fc
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
HOTPLUG_SCRIPT=/usr/sbin/ntpd-hotplug
|
||||
|
||||
while true
|
||||
do
|
||||
STATUS="$(ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')"
|
||||
|
||||
if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ]
|
||||
then
|
||||
ACTION="stratum" /sbin/hotplug-call ntp
|
||||
exit 0
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
Reference in New Issue
Block a user