procd: Add wrapper for uci_validate_section()
[openwrt/openwrt.git] / package / base-files / files / etc / init.d / system
index 8c5f677..a98a972 100755 (executable)
@@ -6,8 +6,8 @@ USE_PROCD=1
 
 validate_system_section()
 {
 
 validate_system_section()
 {
-       uci_validate_section system system "${1}" \
-               'hostname:string:lede' \
+       uci_load_validate system system "$1" "$2" \
+               'hostname:string:OpenWrt' \
                'conloglevel:uinteger' \
                'buffersize:uinteger' \
                'timezone:string:UTC' \
                'conloglevel:uinteger' \
                'buffersize:uinteger' \
                'timezone:string:UTC' \
@@ -15,11 +15,7 @@ validate_system_section()
 }
 
 system_config() {
 }
 
 system_config() {
-       local cfg="$1"
-
-       local hostname conloglevel buffersize timezone zonename
-
-       validate_system_section "${1}" || {
+       [ "$2" = 0 ] || {
                echo "validation failed"
                return 1
        }
                echo "validation failed"
                return 1
        }
@@ -36,7 +32,7 @@ system_config() {
 
 reload_service() {
        config_load system
 
 reload_service() {
        config_load system
-       config_foreach system_config system
+       config_foreach validate_system_section system system_config
 }
 
 service_triggers()
 }
 
 service_triggers()