}
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
}
procd_close_instance
}
+start_service() {
+ validate_ntp_section ntp start_ntpd_instance
+}
+
service_triggers() {
local script name use_dhcp