1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2011 OpenWrt.org
9 validate_ntp_section
() {
10 uci_validate_section system timeserver
"${1}" \
11 'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0'
16 local server enabled enable_server peer
18 validate_ntp_section ntp ||
{
19 echo "validation failed"
23 [ $enabled = 0 ] && return
25 [ -z "$server" ] && return
28 procd_set_param
command "$PROG" -n
29 [ "$enable_server" = "1" ] && procd_append_param
command -l
30 for peer
in $server; do
31 procd_append_param
command -p $peer
33 procd_set_param respawn
39 procd_add_reload_trigger
"system"
40 procd_add_validation validate_ntp_section