cjdns: upgrade uci-defaults for ucitrack handling to use json
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 11 Apr 2024 14:30:13 +0000 (16:30 +0200)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Tue, 16 Apr 2024 06:53:10 +0000 (08:53 +0200)
Conversion of the 'uci-defaults' script for ucitrack handling to the new
json processing.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
cjdns/Makefile
cjdns/files/cjdns.defaults
cjdns/files/luci-app-cjdns.json [new file with mode: 0644]

index c6026102c28e73e2b573fd1e2a6f7bed144d33c0..cd3ccfeb4b13cc0a502ab4dc09be73893d8297d5 100644 (file)
@@ -18,7 +18,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cjdns
 PKG_VERSION:=21.1
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-v$(PKG_VERSION)?
@@ -99,7 +99,8 @@ define Package/cjdns/install
                $(1)/etc/config \
                $(1)/etc/init.d \
                $(1)/etc/uci-defaults \
-               $(1)/usr/lib/lua/cjdns
+               $(1)/usr/lib/lua/cjdns \
+               $(1)/usr/share/ucitrack
 
        $(INSTALL_BIN) \
                ./files/cjdrouteconf \
@@ -121,6 +122,10 @@ define Package/cjdns/install
                ./files/cjdns.defaults \
                $(1)/etc/uci-defaults/cjdns
 
+       $(INSTALL_DATA) \
+               ./files/luci-app-cjdns.json \
+               $(1)/usr/share/ucitrack
+
        $(CP) \
                ./lua/cjdns/* \
                $(1)/usr/lib/lua/cjdns
index b1745f16e420bb0fd8d76e68eb2766d5a0abf9aa..04e9ceb4f4c903cd12b9685bd3b9364c78b87440 100644 (file)
@@ -4,14 +4,6 @@
 uci get cjdns.cjdns.ipv6 >/dev/null 2>&1
 if [ $? -ne 0 ]; then
 
-  # register commit handler
-  uci -q batch <<-EOF >/dev/null
-    delete ucitrack.@cjdns[-1]
-    add ucitrack cjdns
-    set ucitrack.@cjdns[-1].init=cjdns
-    commit ucitrack
-EOF
-
   # generate configuration
   touch /etc/config/cjdns
   cjdroute --genconf | cjdroute --cleanconf | cjdrouteconf set
diff --git a/cjdns/files/luci-app-cjdns.json b/cjdns/files/luci-app-cjdns.json
new file mode 100644 (file)
index 0000000..386b0fa
--- /dev/null
@@ -0,0 +1,4 @@
+{
+       "config": "cjdns",
+       "init": "cjdns"
+}