busybox: use ntp enabled config option
authorJohn Crispin <john@openwrt.org>
Fri, 27 Jun 2014 07:55:03 +0000 (07:55 +0000)
committerJohn Crispin <john@openwrt.org>
Fri, 27 Jun 2014 07:55:03 +0000 (07:55 +0000)
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

package/utils/busybox/Makefile
package/utils/busybox/files/sysntpd

index 6dbd54d746c06523e19115e5b902f6d7e1d5173f..143ad46b530e9272ecc2f4343d8364700e76ab17 100644 (file)
@@ -1,5 +1,5 @@
 # 
 # 
-# Copyright (C) 2006-2013 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.22.1
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.22.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
index c5c3c8e59ab73d50ecc0fa159c59bfbfed282372..417addfb1ca5c0235b8554de1a4368a1385d7964 100755 (executable)
@@ -8,17 +8,19 @@ PROG=/usr/sbin/ntpd
 
 validate_ntp_section() {
        uci_validate_section system timeserver "${1}" \
 
 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() {
 }
 
 start_service() {
-       local server enable_server peer
+       local server enabled enable_server peer
 
        validate_ntp_section ntp || {
                echo "validation failed"
                return 1
        }
 
 
        validate_ntp_section ntp || {
                echo "validation failed"
                return 1
        }
 
+       [ $enabled = 0 ] && return
+
        [ -z "$server" ] && return
 
        procd_open_instance
        [ -z "$server" ] && return
 
        procd_open_instance