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