1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-17 12:53:54 +02:00
openwrt-packages/net/chrony/files/chrony.ntp-hotplug
Miroslav Lichvar 9b6bf46957 chrony: add ntp hotplug provider script
When the service is started, wait for the clock to be synchronized for
up to 5 minutes and provide the stratum action once for ntp hotplug
scripts.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2023-12-18 19:01:44 +02:00

7 lines
183 B
Bash

#!/bin/sh
# Wait for sync for up to 5 minutes and notify other services
/usr/bin/chronyc waitsync 300 1 0.0 1 || exit 0
ubus call hotplug.ntp call '{ "env": [ "ACTION=stratum" ] }'