From 083fd0376f243ffd7d775a2a7085accab6597b52 Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Sat, 27 Mar 2021 09:47:30 +0100 Subject: [PATCH] questd: 5.2.2 disable network module simulate router.network object via rpcd script to support juci clients widget --- questd/Makefile | 4 +- questd/files/usr/libexec/rpcd/router.network | 54 ++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100755 questd/files/usr/libexec/rpcd/router.network diff --git a/questd/Makefile b/questd/Makefile index 969c5e88b..fad6da897 100644 --- a/questd/Makefile +++ b/questd/Makefile @@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=questd -PKG_VERSION:=5.2.1 +PKG_VERSION:=5.2.2 -PKG_SOURCE_VERSION:=d554541ac6fb8ef14431fcec9a31dbcb52181279 +PKG_SOURCE_VERSION:=cd05311b505cc5025a8559c616b55e9fb4d1857d PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd diff --git a/questd/files/usr/libexec/rpcd/router.network b/questd/files/usr/libexec/rpcd/router.network new file mode 100755 index 000000000..300a49790 --- /dev/null +++ b/questd/files/usr/libexec/rpcd/router.network @@ -0,0 +1,54 @@ +#!/bin/sh + +. /usr/share/libubox/jshn.sh +. /lib/functions/network.sh +. /lib/functions.sh + +case "$1" in + list) + echo '{ "dump" : {}, "hosts" : {} }' + ;; + call) + case "$2" in + dump) + dump_network() { + local cfg="$1" + local is_lan type bool proto ipaddr netmask ifname + + [ "$cfg" == "loopback" ] && return + + config_get_bool is_lan $cfg is_lan 0 + config_get type $cfg type + config_get_bool defaultroute $cfg defaultroute 1 + config_get proto $cfg proto none + config_get ipaddr $cfg ipaddr + [ -z "$ipaddr" ] && network_get_ipaddr ipaddr $cfg + config_get netmask $cfg netmask "255.255.255.255" + config_get ifname $cfg ifname + + json_add_object "$cfg" + json_add_boolean is_lan $is_lan + json_add_string type "$type" + json_add_boolean defaultroute $defaultroute + json_add_string proto "$proto" + json_add_string ipaddr "$ipaddr" + json_add_string netmask "$netmask" + json_add_string ifname "$ifname" + json_select .. + } + + config_load network + json_init + config_foreach dump_network interface + json_dump + ;; + hosts) + ubus call topology hosts | \ + sed 's/interface_type/type/g' | \ + sed 's/Ethernet/ethernet/g' | \ + sed 's/Wi-Fi/wifi/g' + ;; + esac + ;; +esac +