Add uci_load_validate() to procd (for tmp. compatibility) upstream : d13e86d4c2d4c1c8...
authorRISCi_ATOM <bob@bobcall.me>
Fri, 26 Jul 2019 17:57:16 +0000 (13:57 -0400)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 26 Jul 2019 17:57:16 +0000 (13:57 -0400)
package/system/procd/files/procd.sh

index e6ca8a6bc924fe65d8832f96a203d0a6edabf987..34dd10d9a252b3153b648a58283f5642248c1244 100644 (file)
@@ -452,6 +452,23 @@ uci_validate_section()
        return $_error
 }
 
+uci_load_validate() {
+       local _package="$1"
+       local _type="$2"
+       local _name="$3"
+       local _function="$4"
+       local _option
+       local _result
+       shift; shift; shift; shift
+       for _option in "$@"; do
+               eval "local ${_option%%:*}"
+       done
+       uci_validate_section "$_package" "$_type" "$_name" "$@"
+       _result=$?
+       [ -n "$_function" ] || return $_result
+       eval "$_function \"\$_name\" \"\$_result\""
+}
+
 _procd_wrapper \
        procd_open_service \
        procd_close_service \