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> SVN-Revision: 43421
This commit is contained in:
3
package/utils/busybox/files/ntpd-hotplug
Executable file
3
package/utils/busybox/files/ntpd-hotplug
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = stratum ] || exit 0
|
||||
ACTION="$1" /sbin/hotplug-call ntp
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user