From: RISCi_ATOM Date: Fri, 26 Jul 2019 17:57:16 +0000 (-0400) Subject: Add uci_load_validate() to procd (for tmp. compatibility) upstream : d13e86d4c2d4c1c8... X-Git-Tag: v1.4.9~15 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f822375299f0f0442b30c91188365c70957cc982;p=librecmc%2Flibrecmc.git Add uci_load_validate() to procd (for tmp. compatibility) upstream : d13e86d4c2d4c1c8970a20cc1f3214b266f57ed0 --- diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index e6ca8a6bc9..34dd10d9a2 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -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 \