jshn.sh: add json_get_vars() wrapper function
authorFelix Fietkau <nbd@openwrt.org>
Sun, 13 May 2012 22:21:12 +0000 (00:21 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 13 May 2012 22:21:12 +0000 (00:21 +0200)
sh/jshn.sh

index d3254606d3d766f14be34f6e8bfb2d7689d4f7fc..117da67b8b2e6722143a7641df1d20b582226a9b 100644 (file)
@@ -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