aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/busybox/files/sysntpd
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-06-27 07:55:03 +0000
committerJohn Crispin <john@openwrt.org>2014-06-27 07:55:03 +0000
commita51588a5f9a5c62206b467def65a13219f2fe0ad (patch)
treecc030b0d9a2c201905bb7be0df0f1bfc2c880fc1 /package/utils/busybox/files/sysntpd
parent818e38625f5ebc050005183c7a11e8ca33243bf7 (diff)
downloadupstream-a51588a5f9a5c62206b467def65a13219f2fe0ad.tar.gz
upstream-a51588a5f9a5c62206b467def65a13219f2fe0ad.tar.bz2
upstream-a51588a5f9a5c62206b467def65a13219f2fe0ad.zip
busybox: use ntp enabled config option
Even if enabled option is missing from ntp configuration we are still keeping default behavior. Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 41355
Diffstat (limited to 'package/utils/busybox/files/sysntpd')
-rwxr-xr-xpackage/utils/busybox/files/sysntpd6
1 files changed, 4 insertions, 2 deletions
diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd
index c5c3c8e59a..417addfb1c 100755
--- a/package/utils/busybox/files/sysntpd
+++ b/package/utils/busybox/files/sysntpd
@@ -8,17 +8,19 @@ PROG=/usr/sbin/ntpd
validate_ntp_section() {
uci_validate_section system timeserver "${1}" \
- 'server:list(host)' 'enable_server:bool:0'
+ 'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0'
}
start_service() {
- local server enable_server peer
+ local server enabled enable_server peer
validate_ntp_section ntp || {
echo "validation failed"
return 1
}
+ [ $enabled = 0 ] && return
+
[ -z "$server" ] && return
procd_open_instance