Sync 2024-08-31 16:27:27

This commit is contained in:
github-actions[bot] 2024-08-31 16:27:27 +08:00
parent 1c64619a12
commit b90a70084c
13 changed files with 164 additions and 102 deletions

View File

@ -49,10 +49,20 @@ peeradd = s:taboption("general",DynamicList, "peeradd", translate("对等节点"
translate("初始连接的对等节点 -p 参数)"))
peeradd.placeholder = "udp://22.1.1.1:11010"
external_node = s:taboption("general", Value, "external_node", translate("共享节点地址"),
external_node = s:taboption("general", DynamicList, "external_node", translate("共享节点地址"),
translate("使用公共共享节点来发现对等节点 -e 参数)"))
external_node.placeholder = "tcp://easytier.public.kkrainbow.top:11010"
external_node.password = true
external_node.default = ""
external_node:value("tcp://easytier.public.kkrainbow.top:11010", translate("tcp://easytier.public.kkrainbow.top:11010"))
external_node:value("tcp://s1.ct8.pl:11010", translate("tcp://s1.ct8.pl:11010"))
external_node:value("tcp://c.oee.icu:60006", translate("tcp://c.oee.icu:60006"))
external_node:value("udp://c.oee.icu:60006", translate("udp://c.oee.icu:60006"))
external_node:value("wss://c.oee.icu:60007", translate("wss://c.oee.icu:60007"))
external_node:value("tcp://etvm.oee.icu:31572", translate("tcp://etvm.oee.icu:31572"))
external_node:value("wss://etvm.oee.icu:30845", translate("wss://etvm.oee.icu:30845"))
external_node:value("tcp://et.323888.xyz:11010", translate("tcp://et.323888.xyz:11010"))
external_node:value("udp://et.323888.xyz:11010", translate("udp://et.323888.xyz:11010"))
external_node:value("wss://et.323888.xyz:11010", translate("wss://et.323888.xyz:11010"))
proxy_network = s:taboption("general",DynamicList, "proxy_network", translate("代理网络"),
translate("将本地网络导出到 VPN 中的其他对等点 -n 参数)"))
@ -64,8 +74,8 @@ rpc_portal.datatype = "range(1,65535)"
listenermode = s:taboption("general",ListValue, "listenermode", translate("监听端口"),
translate("OFF:不监听任何端口,只连接到对等节点 --no-listener 参数)"))
listenermode:value("ON")
listenermode:value("OFF")
listenermode:value("ON",translate("监听"))
listenermode:value("OFF",translate("不监听"))
tcp_port = s:taboption("general",Value, "tcp_port", translate("tcp/udp端口"),
translate("tcp/udp协议端口号11010表示 tcp/udp 将在 11010 上监听"))
@ -117,7 +127,7 @@ mtu.placeholder = "1300"
default_protocol = s:taboption("general",ListValue, "default_protocol", translate("默认协议"),
translate("连接对等节点时使用的默认协议(--default-protocol 参数)"))
default_protocol:value("-")
default_protocol:value("-",translate("默认"))
default_protocol:value("tcp")
default_protocol:value("udp")
default_protocol:value("ws")
@ -171,16 +181,25 @@ socks_port.datatype = "range(1,65535)"
socks_port.placeholder = "1080"
disable_p2p = s:taboption("general",Flag, "disable_p2p", translate("禁用P2P"),
translate("禁用P2P通信只通过-p指定的节点转发数据包"))
translate("禁用P2P通信只通过-p指定的节点转发数据包 --disable-p2p 参数)"))
disable_p2p.rmempty = false
disable_udp = s:taboption("general",Flag, "disable_udp", translate("禁用UDP"),
translate("禁用UDP打洞功能 --disable-udp-hole-punching 参数)"))
disable_udp.rmempty = false
relay_all = s:taboption("general",Flag, "relay_all", translate("允许转发"),
translate("转发所有对等节点的RPC数据包即使对等节点不在转发网络白名单中。<br>这可以帮助白名单外网络中的对等节点建立P2P连接。"))
relay_all.rmempty = false
log = s:taboption("general",Flag, "log", translate("启用日志"),
log = s:taboption("general",ListValue, "log", translate("程序日志"),
translate("运行日志在/tmp/easytier.log,可在上方日志查看"))
log.rmempty = false
log.default = "info"
log:value("off",translate("关闭"))
log:value("info",translate("信息"))
log:value("debug",translate("调试"))
log:value("warn",translate("警告"))
log:value("trace",translate("跟踪"))
check = s:taboption("general",Flag, "check", translate("通断检测"),
translate("开启通断检测后可以指定对端的设备IP当所有指定的IP都ping不通时将会重启easytier程序"))
@ -200,9 +219,28 @@ checktime:depends("check", "1")
local process_status = luci.sys.exec("ps | grep easytier-core| grep -v grep")
btn0 = s:taboption("infos", Button, "btn0")
btn0.inputtitle = translate("node信息")
btn0.description = translate("点击按钮刷新,查看本机信息")
btn0.inputstyle = "apply"
btn0.write = function()
if process_status ~= "" then
luci.sys.call("$(dirname $(uci -q get easytier.@easytier[0].easytierbin))/easytier-cli node >/tmp/easytier-cli_node")
else
luci.sys.call("echo '错误:程序未运行!请启动程序后重新点击刷新' >/tmp/easytier-cli_node")
end
end
btn0info = s:taboption("infos", DummyValue, "btn0info")
btn0info.rawhtml = true
btn0info.cfgvalue = function(self, section)
local content = nixio.fs.readfile("/tmp/easytier-cli_node") or ""
return string.format("<pre>%s</pre>", luci.util.pcdata(content))
end
btn1 = s:taboption("infos", Button, "btn1")
btn1.inputtitle = translate("peer信息")
btn1.description = translate("点击按钮刷新查看peer信息")
btn1.description = translate("点击按钮刷新,查看对端信息")
btn1.inputstyle = "apply"
btn1.write = function()
if process_status ~= "" then

View File

@ -4,6 +4,7 @@
START=99
USE_PROCD=1
size="$(df -k | awk '/\/overlay$/ {sub(/K$/, "", $4); print $4}')"
[ -z "$size" ] && size="$(df -k /usr/bin | awk 'NR==2 {print $(NF-2) }')"
check () {
if [ ! -z "$checkip" ] ; then
@ -62,14 +63,14 @@ start_et() {
upsize="$(du -k /tmp/easytier-core | cut -f1)"
result=$(expr $size - $upsize)
[ -z "$size"] && echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 获取可用空间失败请使用ssh手动上传至 ${easytierbin} ${path}/easytier-cli" >>/tmp/easytier.log
if [ $(($(/tmp/easytier-core -h | wc -l))) -gt 3 ] && [ "$result" -gt 4000 ] ; then
if [ $(($(/tmp/easytier-core -h | wc -l))) -gt 3 ] && [ "$result" -gt 1000 ] ; then
mv -f /tmp/easytier-core "$easytierbin" 2>/dev/null
mv -f /tmp/easytier-cli "${path}/easytier-cli" 2>/dev/null
else
echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 无法替换,上传的程序不完整或自定义路径的可用空间不足,当前空间剩余${size}kb" >>/tmp/easytier.log
fi
fi
if [ ! -f "$easytierbin" ] && [ "$size" -lt 4000 ] ; then
if [ ! -f "$easytierbin" ] && [ "$size" -lt 5000 ] ; then
echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 自定义程序路径的可用空间不足,当前可用空间剩余${size}kb,自动切换为内存/tmp/easytier-core" >>/tmp/easytier.log
sed -i "/easytierbin/c option easytierbin '/tmp/easytier-core' " /etc/config/easytier
easytierbin=/tmp/easytier-core
@ -80,7 +81,7 @@ start_et() {
[ -z "$newtag"] && newtag=v1.2.2
echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 未找到程序 $easytierbin 开始在线下载${newtag},下载较慢耐心等候" >>/tmp/easytier.log
mkdir -p "$path"
curl -L -k -s -o /tmp/easytier.zip --connect-timeout 10 --retry 3 "http://gh.ddlc.top/https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip" || curl -L -k -s -o /tmp/easytier.zip --connect-timeout 10 --retry 3 "https://hub.gitmirror.com/https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip" || curl -L -k -s -o /tmp/easytier.zip --connect-timeout 10 --retry 3 "https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip"
curl -L -k -s -o /tmp/easytier.zip --connect-timeout 10 --retry 3 "http://gh.ddlc.top/https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip" || curl -L -k -s -o /tmp/easytier.zip --connect-timeout 10 --retry 3 "https://hub.gitmirror.com/https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip" || wget --no-check-certificate --quiet --timeout=10 --tries=3 -O /tmp/easytier.zip "http://gh.ddlc.top/https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip" || curl -L -k -s -o /tmp/easytier.zip --connect-timeout 10 --retry 3 "https://github.com/EasyTier/EasyTier/releases/download/${newtag}/easytier-linux-${cpucore}-${newtag}.zip"
unzip -q -o /tmp/easytier.zip -d /tmp
chmod +x /tmp/easytier-linux-${cpucore}-${newtag}/*
mv -f /tmp/easytier-linux-${cpucore}-${newtag}/* ${path}/*
@ -103,7 +104,7 @@ start_et() {
ps | grep 'easytier-core' | grep -v grep | awk '{print $1}' | xargs kill >/dev/null 2>&1
ps | grep 'easytier-core' | grep -v grep | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1
local network_name network_secret ip_dhcp ipaddr peeradd external_node rpc_portal listenermode tunname relay_network disable_p2p
local network_name network_secret ip_dhcp ipaddr peeradd external_node rpc_portal listenermode tunname relay_network disable_p2p disable_udp
local tcp_port ws_port wss_port wg_port desvice_name instance_name vpn_portal mtu default_protocol disable_encryption whitelist socks_port
local multi_thread disable_ipv6 latency_first exit_node exit_nodes smoltcp no_tun manual_routes log check checkip proxy_network relay_all
@ -137,9 +138,10 @@ start_et() {
config_get exit_nodes "$cfg" 'exit_nodes'
config_get_bool no_tun "$cfg" 'no_tun' '0'
config_get manual_routes "$cfg" 'manual_routes'
config_get_bool log "$cfg" 'log' '0'
config_get log "$cfg" 'log' 'off'
config_get_bool check "$cfg" 'check' '0'
config_get_bool disable_p2p "$cfg" 'disable_p2p' '0'
config_get_bool disable_udp "$cfg" 'disable_udp' '0'
config_get_bool relay_all "$cfg" 'relay_all' '0'
config_get checkip "$cfg" 'checkip'
config_get socks_port "$cfg" 'socks_port'
@ -177,6 +179,15 @@ start_et() {
done
fi
fi
if [ ! -z "$external_node" ] ; then
if [[ "$(grep "list external_node" /etc/config/easytier | awk '{print $3}' | wc -l ) " -eq 1 ]]; then
procd_append_param command -e "$external_node"
else
for external_nodes in $(cat /etc/config/easytier | grep 'list external_node' | awk -F 'list external_node' '{print $2}' | sed "s/'/\n/g" | tr -d " ' "); do
procd_append_param command -e "$external_nodes"
done
fi
fi
if [ ! -z "$manual_routes" ] ; then
if [[ "$(grep "list manual_routes" /etc/config/easytier | awk '{print $3}' | wc -l ) " -eq 1 ]]; then
procd_append_param command --manual-routes "$manual_routes"
@ -195,7 +206,6 @@ start_et() {
done
fi
fi
[ -z "$external_node" ] || procd_append_param command -e "$external_node"
[ -z "$rpc_portal" ] || procd_append_param command -r "$rpc_portal"
[ -z "$tcp_port" ] || procd_append_param command -l "tcp:$tcp_port"
[ -z "$tcp_port" ] || procd_append_param command -l "udp:$tcp_port"
@ -216,12 +226,13 @@ start_et() {
[ "$disable_ipv6" = "0" ] || procd_append_param command --disable-ipv6
[ "$latency_first" = "0" ] || procd_append_param command --latency-first
[ "$exit_node" = "0" ] || procd_append_param command --enable-exit-node
[ "$log" = "1" ] && procd_append_param command --file-log-level "info"
[ "$log" = "1" ] && procd_append_param command --file-log-dir "/tmp"
[ "$log" = "0" ] && procd_append_param command --file-log-level "off"
[ "$disable_p2p" = "0" ] || procd_append_param command --disable-p2p
[ "$relay_all" = "0" ] || procd_append_param command --relay-all-peer-rpc
[ -z "$socks_port" ] || procd_append_param command --socks5 "$socks_port"
[ "$log" = "off" ] || procd_append_param command --file-log-level "$log"
[ "$log" = "off" ] || procd_append_param command --file-log-dir "/tmp"
[ "$log" = "off" ] && procd_append_param command --file-log-level "off"
[ "$disable_p2p" = "0" ] || procd_append_param command --disable-p2p
[ "$disable_udp" = "0" ] || procd_append_param command --disable-udp-hole-punching
[ "$relay_all" = "0" ] || procd_append_param command --relay-all-peer-rpc
[ -z "$socks_port" ] || procd_append_param command --socks5 "$socks_port"
[ ! -z "$instance_name" ] && ln -sf /tmp/easytier-${instance_name}.${date_time} /tmp/easytier.log
procd_set_param limits core="unlimited"
@ -344,7 +355,7 @@ start_service() {
fi
cputype=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
[ -n "$(echo $cputype | grep -E "linux.*armv.*")" ] && cpucore="arm"
[ -n "$(echo $cputype | grep -E "linux.*armv7.*")" ] && [ -n "$(cat /proc/cpuinfo | grep vfp)" ] && [ ! -d /jffs/clash ] && cpucore="armv7"
[ -n "$(echo $cputype | grep -E "linux.*armv7.*")" ] && [ -n "$(cat /proc/cpuinfo | grep vfp)" ] && cpucore="armv7"
[ -n "$(echo $cputype | grep -E "linux.*aarch64.*|linux.*armv8.*")" ] && cpucore="aarch64"
[ -n "$(echo $cputype | grep -E "linux.*86.*")" ] && cpucore="i386"
[ -n "$(echo $cputype | grep -E "linux.*86_64.*")" ] && cpucore="x86_64"
@ -378,7 +389,7 @@ stop_service() {
[ -n "$(uci changes network)" ] && uci commit network && /etc/init.d/network reload >/dev/null 2>&1
[ -n "$(uci changes firewall)" ] && uci commit firewall && /etc/init.d/firewall reload >/dev/null 2>&1
rm -rf /tmp/easytier-cli_peer /tmp/easytier-cli_connector /tmp/easytier-cli_stun /tmp/easytier-cli_route >/dev/null 2>&1
rm -rf /tmp/easytier-cli_peer-center /tmp/easytier-cli_vpn-portal /tmp/easytier_cmd >/dev/null 2>&1
rm -rf /tmp/easytier-cli_peer-center /tmp/easytier-cli_vpn-portal /tmp/easytier_cmd /tmp/easytier-cli_node >/dev/null 2>&1
rm -rf /tmp/easytier-*.* /tmp/easytier.log >/dev/null 2>&1
rm -rf /tmp/easytiernew.tag /tmp/easytier.tag >/dev/null 2>&1
echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 停止运行" >>/tmp/easytier.log

View File

@ -3,8 +3,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-03-30 17:00+0200\n"
"PO-Revision-Date: 2023-11-30 14:34+0000\n"
"Last-Translator: rygle <pittos@post.com>\n"
"PO-Revision-Date: 2024-08-26 11:25+0000\n"
"Last-Translator: Kristoffer Grundström <swedishsailfishosuser@tutanota.com>\n"
"Language-Team: English <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsfirewall/en/>\n"
"Language: en\n"
@ -12,7 +12,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.3-dev\n"
"X-Generator: Weblate 5.7.1-dev\n"
#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js:48
msgid ""
@ -291,7 +291,7 @@ msgstr "Drop invalid packets"
#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js:230
#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js:209
msgid "Enable"
msgstr ""
msgstr "Aktivera"
#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js:305
msgid "Enable NAT Loopback"

View File

@ -202,6 +202,17 @@ o:value("default", translate("Use global config") .. "(" .. UDP_REDIR_PORTS .. "
o:value("1:65535", translate("All"))
o.validate = port_validate
o = s:option(ListValue, "direct_dns_query_strategy", translate("Direct Query Strategy"))
o.default = "UseIP"
o:value("UseIP")
o:value("UseIPv4")
o:value("UseIPv6")
o:depends({ node = "default", ['!reverse'] = true })
o = s:option(Flag, "write_ipset_direct", translate("Direct DNS result write to IPSet"), translate("Perform the matching direct domain name rules into IP to IPSet/NFTSet, and then connect directly (not entering the core). Maybe conflict with some special circumstances."))
o.default = "1"
o:depends({ node = "default", ['!reverse'] = true })
o = s:option(ListValue, "remote_dns_protocol", translate("Remote DNS Protocol"))
o:value("tcp", "TCP")
o:value("doh", "DoH")
@ -291,8 +302,4 @@ for k, v in pairs(nodes_table) do
end
end
o = s:option(Flag, "write_ipset_direct", translate("Direct DNS result write to IPSet"), translate("Perform the matching direct domain name rules into IP to IPSet/NFTSet, and then connect directly (not entering the core). Maybe conflict with some special circumstances."))
o.default = "1"
o:depends({ node = "default", ['!reverse'] = true })
return m

View File

@ -337,7 +337,7 @@ run_xray() {
[ -n "${direct_ipset}" ] && _extra_param="${_extra_param} -direct_ipset ${direct_ipset}"
[ -n "${direct_nftset}" ] && _extra_param="${_extra_param} -direct_nftset ${direct_nftset}"
}
_extra_param="${_extra_param} -direct_dns_udp_port ${DIRECT_DNS_UDP_PORT} -direct_dns_udp_server ${DIRECT_DNS_UDP_SERVER} -direct_dns_query_strategy UseIP"
_extra_param="${_extra_param} -direct_dns_udp_port ${DIRECT_DNS_UDP_PORT} -direct_dns_udp_server ${DIRECT_DNS_UDP_SERVER} -direct_dns_query_strategy ${direct_dns_query_strategy}"
DNS_REMOTE_ARGS=""
case "$remote_dns_protocol" in

View File

@ -108,14 +108,14 @@ local function fetch_geosite()
local json = jsonc.parse(content)
if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do
if v.name and v.name == "geosite.dat.sha256sum" then
if v.name and (v.name == "geosite.dat.sha256sum" or v.name == "dlc.dat.sha256sum") then
local sret = curl(v.browser_download_url, "/tmp/geosite.dat.sha256sum")
if sret == 200 then
local f = io.open("/tmp/geosite.dat.sha256sum", "r")
local content = f:read()
f:close()
f = io.open("/tmp/geosite.dat.sha256sum", "w")
f:write(content:gsub("geosite.dat", "/tmp/geosite.dat"), "")
f:write(content:gsub("[^%s]+.dat", "/tmp/geosite.dat"), "")
f:close()
if nixio.fs.access(asset_location .. "geosite.dat") then
@ -126,7 +126,7 @@ local function fetch_geosite()
end
end
for _2, v2 in ipairs(json.assets) do
if v2.name and v2.name == "geosite.dat" then
if v2.name and (v2.name == "geosite.dat" or v2.name == "dlc.dat") then
sret = curl(v2.browser_download_url, "/tmp/geosite.dat")
if luci.sys.call('sha256sum -c /tmp/geosite.dat.sha256sum > /dev/null 2>&1') == 0 then
luci.sys.call(string.format("mkdir -p %s && cp -f %s %s", asset_location, "/tmp/geosite.dat", asset_location .. "geosite.dat"))

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mihomo
PKG_RELEASE:=45
PKG_RELEASE:=46
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git
PKG_SOURCE_DATE:=2024-08-29
PKG_SOURCE_VERSION:=38fd37108b22b0e937cae7743c562a2147c65cca
PKG_SOURCE_DATE:=2024-08-30
PKG_SOURCE_VERSION:=08ac9a3fae545d521626ecb6cb9b290e51a394b0
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=MIT

View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=my-default-settings
PKG_VERSION:=1
PKG_RELEASE:=265
PKG_RELEASE:=266
include $(INCLUDE_DIR)/package.mk

View File

@ -66,70 +66,11 @@ if [[ ! "$version" || "$version" -lt 1 ]]; then
uci commit upnpd
(echo "root"; sleep 1; echo "root") | /bin/busybox passwd root >/dev/null 2>&1 &
. /etc/openwrt_release
uci -q set firewall.@defaults[0].flow_offloading='1'
uci -q set firewall.@defaults[0].flow_offloading_hw='1'
uci commit firewall
sed -i '/option disabled/d' /etc/config/wireless
wifi_setup_radio(){
local radio=$1
htmode="$(uci -q get wireless.${radio}.htmode)"
if uci -q get wireless.${radio} >/dev/null; then
uci -q del wireless.${radio}.disabled
uci -q set wireless.${radio}.country='US'
uci -q set wireless.${radio}.mu_beamformer='1'
uci -q set wireless.${radio}.cell_density='3'
if [ "$(uci -q get wireless.${radio}.band)" = "5g" ]; then
uci -q set wireless.default_${radio}.ssid="${SSID}_5G"
if [[ "${htmode}" == HE* ]]; then # AX
if [[ "$(board_name)" == *cr660x || "$(board_name)" == *ax9000 || "$DISTRIB_TARGET" == *ipq60xx ]]; then
uci -q set wireless.${radio}.htmode="HE80"
uci -q set wireless.${radio}.channel='157'
else
uci -q set wireless.${radio}.htmode="HE160"
uci -q set wireless.${radio}.channel='44'
fi
else
uci -q set wireless.${radio}.htmode="VHT80" #AC
uci -q set wireless.${radio}.channel="157"
fi
if [[ "$(board_name)" == *ax6000 ]]; then
uci -q set wireless.${radio}.htmode="VHT160"
fi
else
uci -q set wireless.${radio}.htmode="HT40" #N
uci -q set wireless.${radio}.noscan='1'
uci -q set wireless.${radio}.vendor_vht='1'
uci -q set wireless.default_${radio}.ssid="${SSID}_2.4G"
uci -q set wireless.${radio}.channel='6'
fi
uci -q set wireless.default_${radio}.device="${radio}"
if [ "${SSID_PASSWD}" ]; then
uci -q set wireless.default_${radio}.encryption='psk2'
uci -q set wireless.default_${radio}.key="${SSID_PASSWD}"
else
uci -q set wireless.default_${radio}.encryption='none'
fi
fi
}
if [[ -f /etc/config/wireless ]]; then
SSID=${hostname}
SSID_PASSWD=""
[ "$(uci -q get wireless.radio1.band)" == "5g" ] && uci -q set wireless.radio0.band="2g"
widx=0
while uci rename wireless.@wifi-iface[$widx]=default_radio$widx >/dev/null 2>&1; do widx=$((widx+1)); done
for radio in radio0 radio1 radio2 radio3; do
wifi_setup_radio ${radio}
done
uci commit wireless
fi
uci -q set upnpd.config.enabled='1'
uci commit upnpd

View File

@ -0,0 +1,65 @@
#!/bin/sh
. /etc/openwrt_release
board_name() {
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
}
SSID="$(uci -q get wizard.default.wifi_ssid || uci -q get system.@system[0].hostname || echo Kwrt)"
SSID_PASSWD="$(uci -q get wizard.default.wifi_key)"
sed -i '/option disabled/d' /etc/config/wireless
wifi_setup_radio(){
local radio=$1
htmode="$(uci -q get wireless.${radio}.htmode)"
if uci -q get wireless.${radio} >/dev/null; then
uci -q del wireless.${radio}.disabled
uci -q set wireless.${radio}.country='US'
uci -q set wireless.${radio}.mu_beamformer='1'
uci -q set wireless.${radio}.cell_density='3'
if [ "$(uci -q get wireless.${radio}.band)" = "5g" ]; then
uci -q set wireless.default_${radio}.ssid="${SSID}_5G"
if [[ "${htmode}" == HE* ]]; then # AX
if [[ "$(board_name)" == *cr660x || "$(board_name)" == *ax9000 || "$DISTRIB_TARGET" == *ipq60xx ]]; then
uci -q set wireless.${radio}.htmode="HE80"
uci -q set wireless.${radio}.channel='157'
else
uci -q set wireless.${radio}.htmode="HE160"
uci -q set wireless.${radio}.channel='44'
fi
else
uci -q set wireless.${radio}.htmode="VHT80" #AC
uci -q set wireless.${radio}.channel="157"
fi
if [[ "$(board_name)" == *ax6000 ]]; then
uci -q set wireless.${radio}.htmode="VHT160"
fi
else
uci -q set wireless.${radio}.htmode="HT40" #N
uci -q set wireless.${radio}.noscan='1'
uci -q set wireless.${radio}.vendor_vht='1'
uci -q set wireless.default_${radio}.ssid="${SSID}_2.4G"
uci -q set wireless.${radio}.channel='6'
fi
uci -q set wireless.default_${radio}.device="${radio}"
if [ "${SSID_PASSWD}" ]; then
uci -q set wireless.default_${radio}.encryption='psk2'
uci -q set wireless.default_${radio}.key="${SSID_PASSWD}"
else
uci -q set wireless.default_${radio}.encryption='none'
fi
fi
}
if [[ -f /etc/config/wireless ]]; then
SSID=${hostname}
SSID_PASSWD=""
[ "$(uci -q get wireless.radio1.band)" == "5g" ] && uci -q set wireless.radio0.band="2g"
widx=0
while uci rename wireless.@wifi-iface[$widx]=default_radio$widx >/dev/null 2>&1; do widx=$((widx+1)); done
for radio in radio0 radio1 radio2 radio3; do
wifi_setup_radio ${radio}
done
uci commit wireless
fi

View File

@ -2,11 +2,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=tun2socks
PKG_VERSION:=2.5.2
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/xjasonlyu/tun2socks.git
PKG_SOURCE_VERSION:=601601a1dc3accfce53032716e10dafe34df3d2e
PKG_SOURCE_VERSION:=1f09b4d42d08b3a1292c5d5dfeff040969a1e56c
PKG_MAINTAINER:=Konstantine Shevlakov <shevlako@132lan.ru>
PKG_LICENSE:=GPL-3.0

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=wifi-scripts
PKG_VERSION:=1.0
PKG_RELEASE:=10
PKG_RELEASE:=11
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

View File

@ -185,7 +185,7 @@ wifi_config() {
done
[ ! -f /etc/config/wireless ] && touch /etc/config/wireless
ucode /lib/wifi/mac80211.uc | uci -q batch
. /sbin/mywifi
for driver in $DRIVERS; do (
if eval "type detect_$driver" 2>/dev/null >/dev/null; then
eval "detect_$driver" || echo "$driver: Detect failed" >&2