update-12.10

This commit is contained in:
github-actions[bot] 2021-12-10 09:04:39 +08:00
parent e53048a1e8
commit cd75f9c162
12 changed files with 42 additions and 149 deletions

View File

@ -1,14 +0,0 @@
#
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for advancedsetting
LUCI_DEPENDS:=
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,14 +0,0 @@
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
module("luci.controller.advancedsetting", package.seeall)
function index()
if not nixio.fs.access("/etc/config/advancedsetting") then
return
end
local page
page = entry({"admin", "system", "advancedsetting"}, cbi("advancedsetting"), _("Advanced Setting"), 60)
page.dependent = true
page.acl_depends = { "luci-app-advancedsetting" }
end

View File

@ -1,75 +0,0 @@
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
local fs = require "nixio.fs"
local sys = require "luci.sys"
m = Map("advancedsetting", translate("Advanced Setting"), translate("Direct editing of built-in Script Documents for various services, unless you know what you are doing, do not easily modify these configuration documents"))
s = m:section(TypedSection, "advancedsetting")
s.anonymous=true
--dnsmasq
if nixio.fs.access("/etc/dnsmasq.conf") then
s:tab("config1", translate("dnsmasq"),translate("This page is the document content for configuring /etc/dnsmasq.conf. Restart takes effect after application is saved"))
conf = s:taboption("config1", Value, "editconf1", nil, translate("Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."))
conf.template = "cbi/tvalue"
conf.rows = 20
conf.wrap = "off"
function conf.cfgvalue(self, section)
return fs.readfile("/etc/dnsmasq.conf") or ""
end
function conf.write(self, section, value)
if value then
value = value:gsub("\r\n?", "\n")
fs.writefile("/tmp/dnsmasq.conf", value)
if (luci.sys.call("cmp -s /tmp/dnsmasq.conf /etc/dnsmasq.conf") == 1) then
fs.writefile("/etc/dnsmasq.conf", value)
luci.sys.call("/etc/init.d/dnsmasq restart >/dev/null")
end
fs.remove("/tmp/dnsmasq.conf")
end
end
end
--network
if nixio.fs.access("/etc/config/network") then
s:tab("config2", translate("network"),translate("This page is the document content for configuring /etc/config/network. Restart takes effect after application is saved"))
conf = s:taboption("config2", Value, "editconf2", nil, translate("Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."))
conf.template = "cbi/tvalue"
conf.rows = 20
conf.wrap = "off"
function conf.cfgvalue(self, section)
return fs.readfile("/etc/config/network") or ""
end
function conf.write(self, section, value)
if value then
value = value:gsub("\r\n?", "\n")
fs.writefile("/tmp/netwok", value)
if (luci.sys.call("cmp -s /tmp/network /etc/config/network") == 1) then
fs.writefile("/etc/config/network", value)
luci.sys.call("/etc/init.d/network restart >/dev/null")
end
fs.remove("/tmp/network")
end
end
end
--hosts
if nixio.fs.access("/etc/hosts") then
s:tab("config3", translate("hosts"),translate("This page is the document content for configuring /etc/hosts. Restart takes effect after application is saved"))
conf = s:taboption("config3", Value, "editconf3", nil, translate("Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."))
conf.template = "cbi/tvalue"
conf.rows = 20
conf.wrap = "off"
function conf.cfgvalue(self, section)
return fs.readfile("/etc/hosts") or ""
end
function conf.write(self, section, value)
if value then
value = value:gsub("\r\n?", "\n")
fs.writefile("/tmp/etc/hosts", value)
if (luci.sys.call("cmp -s /tmp/etc/hosts /etc/hosts") == 1) then
fs.writefile("/etc/hosts", value)
luci.sys.call("/etc/init.d/dnsmasq restart >/dev/null")
end
fs.remove("/tmp/etc/hosts")
end
end
end
return m

View File

@ -1 +0,0 @@
zh_Hans

View File

@ -1,21 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "Advanced Setting"
msgstr "高级设置"
msgid "Direct editing of built-in Script Documents for various services, unless you know what you are doing, do not easily modify these configuration documents"
msgstr "各类服务内置脚本文档的直接编辑,除非你知道自己在干什么,否则请不要轻易修改这些配置文档"
msgid "This page is the document content for configuring /etc/dnsmasq.conf. Restart takes effect after application is saved"
msgstr "本页是配置/etc/dnsmasq.conf的文档内容。应用保存后重启生效"
msgid "Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."
msgstr "开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。"
msgid "This page is the document content for configuring /etc/config/network. Restart takes effect after application is saved"
msgstr "本页是配置/etc/config/network的文档内容。"
msgid "This page is the document content for configuring /etc/hosts. Restart takes effect after application is saved"
msgstr "本页是配置/etc/hosts的文档内容。"

View File

@ -1 +0,0 @@
config advancedsetting

View File

@ -1,11 +0,0 @@
{
"luci-app-advancedsetting": {
"description": "Grant UCI access for luci-app-advancedsetting",
"read": {
"uci": [ "advancedsetting" ]
},
"write": {
"uci": [ "advancedsetting" ]
}
}
}

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for easymesh
LUCI_DEPENDS:= +kmod-cfg80211 +batctl-default +kmod-batman-adv +wpad-mesh-openssl +dawn
PKG_VERSION:=1.9
PKG_VERSION:=2.0
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -46,6 +46,12 @@ o = s:option(Flag, "enabled", translate("Enable"), translate("Enable or disable
o.default = 0
o.rmempty = false
o = s:option(ListValue, "role", translate("role"))
o:value("off", translate("off"))
o:value("server", translate("host MESH"))
o:value("client", translate("son MESH"))
o.rmempty = false
apRadio = s:option(ListValue, "apRadio", translate("MESH Radio device"), translate("The radio device which MESH use"))
uci:foreach("wireless", "wifi-device",
function(s)

View File

@ -28,6 +28,18 @@ msgstr "基本设置"
msgid "Enable"
msgstr "启用"
msgid "role"
msgstr "角色"
msgid "off"
msgstr "关闭"
msgid "host MESH"
msgstr "主MESH"
msgid "son MESH"
msgstr "子MESH"
msgid "MESH Radio device"
msgstr "MESH无线设备"

View File

@ -1,6 +1,6 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10
STOP=70
enable=$(uci get easymesh.config.enabled 2>/dev/null)
mesh_bat0=$(uci get network.bat0 2>/dev/null)
@ -14,6 +14,7 @@ ap_ipaddr1=$(cat /etc/easymesh | sed -n '1p' 2>/dev/null)
apRadio=$(uci get easymesh.config.apRadio 2>/dev/null)
kvr=$(uci get easymesh.config.kvr 2>/dev/null)
brlan=$(uci get network.@device[0].name 2>/dev/null)
role=$(uci get easymesh.config.role 2>/dev/null)
ap_mode_stop(){
ap_ipaddr=$(uci get network.lan.ipaddr 2>/dev/null)
@ -47,8 +48,8 @@ add_wifi_mesh(){
if [ "$mesh_nwi_mesh" != "interface" ]; then
uci set network.nwi_mesh_$apall=interface
uci set network.nwi_mesh_$apall.proto='batadv_hardif'
uci set network.nwi_mesh_$apall.mtu='2304'
uci set network.nwi_mesh_$apall.master='bat0'
uci set network.nwi_mesh_$apall.mtu='1536'
uci commit network
fi
@ -58,8 +59,11 @@ add_wifi_mesh(){
uci set wireless.mesh_$apall.ifname=mesh_${apall}
uci set wireless.mesh_$apall.network=nwi_mesh_${apall}
uci set wireless.mesh_$apall.mode='mesh'
uci set wireless.mesh_$apall.mesh_fwding='0'
uci set wireless.mesh_$apall.mesh_id=$mesh_id
uci set wireless.mesh_$apall.mesh_fwding='0'
uci set wireless.mesh_$apall.mesh_ttl='1'
uci set wireless.mesh_$apall.mcast_rate='24000'
uci set wireless.mesh_$apall.disabled='0'
uci commit wireless
fi
@ -127,21 +131,29 @@ start(){
uci set network.bat0.proto='batadv'
uci set network.bat0.routing_algo='BATMAN_IV'
uci set network.bat0.aggregated_ogms='1'
#uci set network.bat0.gw_bandwidth='10000/2000'
uci set network.bat0.ap_isolation='0'
uci set network.bat0.bonding='0'
uci set network.bat0.fragmentation='1'
uci set network.bat0.gw_mode='off'
#uci set network.bat0.gw_sel_class='20'
uci set network.bat0.log_level='0'
uci set network.bat0.orig_interval='1000'
uci set network.bat0.bridge_loop_avoidance='1'
uci set network.bat0.distributed_arp_table='1'
uci set network.bat0.multicast_mode='1'
uci set network.bat0.network_coding='0'
uci set network.bat0.fragmentation='1'
#uci set network.bat0.gw_bandwidth='10000/2000'
#uci set network.bat0.gw_sel_class='20'
uci set network.bat0.hop_penalty='30'
uci set network.bat0.isolation_mark='0x00000000/0x00000000'
uci set network.bat0.log_level='0'
uci set network.bat0.multicast_fanout='16'
uci set network.bat0.multicast_mode='1'
uci set network.bat0.network_coding='0'
uci set network.bat0.orig_interval='1000'
if [ "$role" = "server" ]; then
uci set network.bat0.gw_mode='server'
elif [ "$role" = "client" ]; then
uci set network.bat0.gw_mode='client'
else
uci set network.bat0.gw_mode='off'
fi
if [ "$brlan" = "br-lan" ]; then
uci add_list network.@device[0].ports='bat0'
else