From: Felix Fietkau Date: Sun, 13 May 2012 22:21:12 +0000 (+0200) Subject: jshn.sh: add json_get_vars() wrapper function X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=commitdiff_plain;h=97ed91fa77e3e2926bab3e70955a0e2b511db86e;ds=sidebyside jshn.sh: add json_get_vars() wrapper function --- diff --git a/sh/jshn.sh b/sh/jshn.sh index d325460..117da67 100644 --- a/sh/jshn.sh +++ b/sh/jshn.sh @@ -104,6 +104,13 @@ json_get_var() { eval "export -- \"$dest=\${${JSON_CUR}_$var}\"" } +json_get_vars() { + while [ "$#" -gt 0 ]; do + local _var="$1"; shift + json_get_var "$_var" "$_var" + done +} + json_select() { local target="$1" local type