diff options
author | Steven Barth <steven@midlink.org> | 2014-11-28 11:41:25 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-11-28 11:41:25 +0000 |
commit | 753167106850ac0cf651484208a4fc7fbf2e1bd1 (patch) | |
tree | 3a21cbae5969831e97bc40e8a2539b32cf8cd33e /package/utils/busybox/files | |
parent | b20633bf4490000699125b110d987303368f1040 (diff) | |
download | master-187ad058-753167106850ac0cf651484208a4fc7fbf2e1bd1.tar.gz master-187ad058-753167106850ac0cf651484208a4fc7fbf2e1bd1.tar.bz2 master-187ad058-753167106850ac0cf651484208a4fc7fbf2e1bd1.zip |
ntp: add hotplug class for ntp-events
Based on a patch by Luiz Angelo Daros de Luca
Signed-off-by: Steven Barth <steven@midlink.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43421 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/utils/busybox/files')
-rwxr-xr-x | package/utils/busybox/files/ntpd-hotplug | 3 | ||||
-rwxr-xr-x | package/utils/busybox/files/sysntpd | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/package/utils/busybox/files/ntpd-hotplug b/package/utils/busybox/files/ntpd-hotplug new file mode 100755 index 0000000000..ddc1490a47 --- /dev/null +++ b/package/utils/busybox/files/ntpd-hotplug @@ -0,0 +1,3 @@ +#!/bin/sh +[ "$1" = stratum ] || exit 0 +ACTION="$1" /sbin/hotplug-call ntp diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd index 417addfb1c..f73bb83082 100755 --- a/package/utils/busybox/files/sysntpd +++ b/package/utils/busybox/files/sysntpd @@ -5,6 +5,7 @@ START=98 USE_PROCD=1 PROG=/usr/sbin/ntpd +HOTPLUG_SCRIPT=/usr/sbin/ntpd-hotplug validate_ntp_section() { uci_validate_section system timeserver "${1}" \ @@ -26,6 +27,7 @@ start_service() { procd_open_instance procd_set_param command "$PROG" -n [ "$enable_server" = "1" ] && procd_append_param command -l + [ -x "$HOTPLUG_SCRIPT" ] && procd_append_param command -S "$HOTPLUG_SCRIPT" for peer in $server; do procd_append_param command -p $peer done |