Skip to content
Snippets Groups Projects
Commit 8b6916c3 authored by Reidar Cederqvist's avatar Reidar Cederqvist Committed by Sukru Senli
Browse files

ntpd: add support for configuring ntp pools

parent 53bd2a41
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ emit() {
validate_ntp_section() {
uci_load_validate system timeserver "$1" "$2" \
'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' \
'pool:list(host)' \
'interface:list(string)'
}
......@@ -34,7 +35,7 @@ start_ntpd_instance() {
[ "$enabled" = 0 ] && return
[ -z "$server" -a "$enable_server" = 0 ] && return
[ -z "$server" -a -z "$pool" -a "$enable_server" = 0 ] && return
# not sure that the interfaces enumerated should be validated,
# since some of them might be dynamic interfaces (like IPsec
......@@ -73,6 +74,11 @@ start_ntpd_instance() {
emit "server $i iburst"
done
for i in $pool
do
emit "pool $i iburst"
done
mkdir -p /var/lib/ntp
chown -R ntp:ntp /var/lib/ntp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment