vti: add vti specific settings as nested json object
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 14 Mar 2017 21:39:43 +0000 (22:39 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 21 Mar 2017 21:59:08 +0000 (22:59 +0100)
Add vti specific settings ikey and okey as a nested data json object

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
package/network/config/vti/Makefile
package/network/config/vti/files/vti.sh

index bda2a9ab17a2696fa36087b2aa8f3d39026ffb6d..0a4657c94ee6adc340a23c26b792ad6fff1aa816 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vti
 PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index 763fd4ee320ac6fea07cf9fac1037a6e8375e67e..0443800a0c8f06ee11a44bc719931f2295ccbf47 100755 (executable)
@@ -26,7 +26,12 @@ vti_generic_setup() {
        json_add_string local "$local"
        json_add_string remote "$remote"
        [ -n "$tunlink" ] && json_add_string link "$tunlink"
-       json_add_string info "${ikey:-0},${okey:-0}"
+
+       json_add_object 'data'
+       [ -n "$ikey" ] && json_add_int ikey "$ikey"
+       [ -n "$okey" ] && json_add_int okey "$okey"
+       json_close_object
+
        proto_close_tunnel
 
        proto_add_data