X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=package%2Futils%2Fbusybox%2Ffiles%2Fsysntpd;fp=package%2Futils%2Fbusybox%2Ffiles%2Fsysntpd;h=52866ba32acd26a490f9c9024fc3e43e0f757496;hp=e693e4031c04a6efaf6055522aaa0fa4cbf44b95;hb=d13e86d4c2d4c1c8970a20cc1f3214b266f57ed0;hpb=2bf22b1fb725b71ca1ec2656be4b020efcc29289 diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd index e693e4031c..52866ba32a 100755 --- a/package/utils/busybox/files/sysntpd +++ b/package/utils/busybox/files/sysntpd @@ -29,14 +29,14 @@ get_dhcp_ntp_servers() { } validate_ntp_section() { - uci_validate_section system timeserver "${1}" \ + uci_load_validate system timeserver "$1" "$2" \ 'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' 'use_dhcp:bool:1' 'dhcp_interface:list(string)' } -start_service() { - local server enabled enable_server use_dhcp dhcp_interface peer +start_ntpd_instance() { + local peer - validate_ntp_section ntp || { + [ "$2" = 0 ] || { echo "validation failed" return 1 } @@ -58,6 +58,10 @@ start_service() { procd_close_instance } +start_service() { + validate_ntp_section ntp start_ntpd_instance +} + service_triggers() { local script name use_dhcp