Browse Source

Add uci_load_validate() to procd (for tmp. compatibility) upstream : d13e86d4c2d4c1c8970a20cc1f3214b266f57ed0

RISCi_ATOM 4 years ago
parent
commit
f822375299
1 changed files with 17 additions and 0 deletions
  1. 17 0
      package/system/procd/files/procd.sh

+ 17 - 0
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 \