Skip to content

Commit

Permalink
v4.2.2
Browse files Browse the repository at this point in the history
1.优化静态分流模式控制流程,改善该模式下的数据传
  输品质,及 wireguard 客户端接通率。
2.修复「IPTV 机顶盒访问 IPTV 线路方式」设置为
  「按服务地址访问」后,IPTV 连接失败的 bug。
3.优化 Web UI 服务事件触发接口,提高扩展能力。
4.更新运营商 IP 地址数据文件。
  • Loading branch information
larsonzh authored Sep 30, 2023
1 parent 5f08ab9 commit 0f2e706
Show file tree
Hide file tree
Showing 15 changed files with 237 additions and 160 deletions.
8 changes: 4 additions & 4 deletions source_codes/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# install.sh v4.2.1
# install.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

# LZ RULE script for Asuswrt-Merlin Router
Expand All @@ -11,7 +11,7 @@

#BEIGIN

LZ_VERSION=v4.2.1
LZ_VERSION=v4.2.2
TIMEOUT=10
CURRENT_PATH="${0%/*}"
[ "${CURRENT_PATH:0:1}" != '/' ] && CURRENT_PATH="$( pwd )${CURRENT_PATH#*.}"
Expand Down Expand Up @@ -248,9 +248,9 @@ lz_create_service_event_interface() {
/$( lz_get_delete_row_regular_expression_string "lz_rule_service.sh" )/d;
/^[[:space:]]*$/d;
}" "/jffs/scripts/service-event"
sed -i "1a ${PATH_INTERFACE}/lz_rule_service.sh \$\{@\} \& # Added by LZRule" "/jffs/scripts/service-event"
sed -i "1a ${PATH_INTERFACE}/lz_rule_service.sh \$\{@\} # Added by LZRule" "/jffs/scripts/service-event"
chmod +x "/jffs/scripts/service-event"
! grep -q "^${PATH_INTERFACE}/lz_rule_service[\.]sh \$[\{]@[\}] [\&]" "/jffs/scripts/service-event" && return "1"
! grep -q "^${PATH_INTERFACE}/lz_rule_service[\.]sh \$[\{]@[\}] # Added by LZRule" "/jffs/scripts/service-event" && return "1"
return "0"
}

Expand Down
8 changes: 8 additions & 0 deletions source_codes/lz/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v4.2.2 (2023/9/30)
1.优化静态分流模式控制流程,改善该模式下的数据传
输品质,及 wireguard 客户端接通率。
2.修复「IPTV 机顶盒访问 IPTV 线路方式」设置为
「按服务地址访问」后,IPTV 连接失败的 bug。
3.优化 Web UI 服务事件触发接口,提高扩展能力。
4.更新运营商 IP 地址数据文件。

v4.2.1 (2023/9/26)
1.修复静态分流模式下,负载均衡国外运营商网段流量
出口时,分流控制失效的问题。
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/configs/lz_rule_config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_rule_config.sh v4.2.1
# lz_rule_config.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

# 本软件采用CIDR(无类别域间路由,Classless Inter-Domain Routing)技术,是一个在Internet上创建附加地
Expand Down
1 change: 1 addition & 0 deletions source_codes/lz/data/lz_hk_cidr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@
103.173.12.0/23
103.173.26.0/23
103.173.56.0/24
103.173.145.0/24
103.173.224.0/23
103.175.128.0/23
103.175.196.0/23
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/func/lz_clear_custom_scripts_data.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_clear_custom_scripts_data.sh v4.2.1
# lz_clear_custom_scripts_data.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

## 清除用户自定义脚本数据
Expand Down
11 changes: 8 additions & 3 deletions source_codes/lz/func/lz_define_global_variables.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_define_global_variables.sh v4.2.1
# lz_define_global_variables.sh v4.2.2
# By LZ 妙妙呜 ([email protected])
# QnkgTFog5aaZ5aaZ5ZGc77yI6Juk6J+G5aKp5YS/77yJ(首次运行标识,切勿修改)

Expand Down Expand Up @@ -420,11 +420,16 @@ route_hardware_type="$( uname -m )"
## 路由器操作系统名称
route_os_name="$( uname -o )"

## 路由器本地静态子网
route_static_subnet="$( ip -o -4 address list | awk '$2 == "br0" {print $4}' | grep -Eo '([0-9]{1,3}[\.]){3}[0-9]{1,3}([\/][0-9]{1,3}){0,1}' )"

## 路由器本地IP地址
route_local_ip=
route_local_ip="${route_static_subnet%/*}"

## 路由器本地子网
route_local_subnet=
route_local_subnet=""
[ -n "${route_static_subnet}" ] && route_local_subnet="${route_static_subnet%.*}.0"
[ "${route_static_subnet}" != "${route_static_subnet##*/}" ] && route_local_subnet="${route_local_subnet}/${route_static_subnet##*/}"

## 静态分流模式整体通道推送命令是否执行(0--未执行;1--已执行)
command_from_all_executed="0"
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/func/lz_initialize_config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_initialize_config.sh v4.2.1
# lz_initialize_config.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

## 初始化脚本配置
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/func/lz_rule_address_query.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_rule_address_query.sh v4.2.1
# lz_rule_address_query.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

## 网址信息查询脚本
Expand Down
105 changes: 74 additions & 31 deletions source_codes/lz/func/lz_rule_func.sh

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions source_codes/lz/func/lz_rule_status.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_rule_status.sh v4.2.1
# lz_rule_status.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

## 显示脚本运行状态脚本
Expand Down Expand Up @@ -212,7 +212,7 @@ lz_get_domain_data_file_item_total_status() {
lz_get_unkonwn_ipv4_src_addr_data_file_item_status() {
local retval="1"
[ -f "${1}" ] && {
retval="$( awk '($1 == "0.0.0.0/0" || $1 == "0.0.0.0") && NF >= "1" {print "0"; exit}' "${1}" )"
retval="$( awk '($1 == "0.0.0.0/0" || $1 == "0.0.0.0" || $1 == "'"${status_route_local_subnet}"'") && NF >= "1" {print "0"; exit}' "${1}" )"
[ -z "${retval}" ] && retval="1"
}
return "${retval}"
Expand All @@ -227,7 +227,7 @@ lz_get_unkonwn_ipv4_src_addr_data_file_item_status() {
lz_get_unkonwn_ipv4_src_dst_addr_data_file_item_status() {
local retval="1"
[ -f "${1}" ] && {
retval="$( awk '($1 == "0.0.0.0/0" || $1 == "0.0.0.0") && ($2 == "0.0.0.0/0" || $2 == "0.0.0.0") && NF >= "2" {print "0"; exit}' "${1}" )"
retval="$( awk '($1 == "0.0.0.0/0" || $1 == "0.0.0.0" || $1 == "'"${status_route_local_subnet}"'") && ($2 == "0.0.0.0/0" || $2 == "0.0.0.0") && NF >= "2" {print "0"; exit}' "${1}" )"
[ -z "${retval}" ] && retval="1"
}
return "${retval}"
Expand All @@ -242,7 +242,7 @@ lz_get_unkonwn_ipv4_src_dst_addr_data_file_item_status() {
lz_get_unkonwn_ipv4_src_dst_addr_port_data_file_item_status() {
local retval="1"
[ -f "${1}" ] && {
retval="$( awk '($1 == "0.0.0.0/0" || $1 == "0.0.0.0") && ($2 == "0.0.0.0/0" || $2 == "0.0.0.0") && NF == "2" {print "0"; exit}' "${1}" )"
retval="$( awk '($1 == "0.0.0.0/0" || $1 == "0.0.0.0" || $1 == "'"${status_route_local_subnet}"'") && ($2 == "0.0.0.0/0" || $2 == "0.0.0.0") && NF == "2" {print "0"; exit}' "${1}" )"
[ -z "${retval}" ] && retval="1"
}
return "${retval}"
Expand Down Expand Up @@ -341,7 +341,11 @@ lz_set_parameter_status_variable() {
status_policy_mode=
status_route_hardware_type=
status_route_os_name=
status_route_local_ip=
status_route_static_subnet="$( ip -o -4 address list | awk '$2 == "br0" {print $4}' | grep -Eo '([0-9]{1,3}[\.]){3}[0-9]{1,3}([\/][0-9]{1,3}){0,1}' )"
status_route_local_ip="${status_route_static_subnet%/*}"
status_route_local_subnet=""
[ -n "${status_route_static_subnet}" ] && status_route_local_subnet="${status_route_static_subnet%.*}.0"
[ "${status_route_static_subnet}" != "${status_route_static_subnet##*/}" ] && status_route_local_subnet="${status_route_local_subnet}/${status_route_static_subnet##*/}"
status_ip_rule_exist=0
status_adjust_traffic_policy="5"
}
Expand Down Expand Up @@ -417,7 +421,9 @@ lz_unset_parameter_status_variable() {
unset status_policy_mode
unset status_route_hardware_type
unset status_route_os_name
unset status_route_static_subnet
unset status_route_local_ip
unset status_route_local_subnet
unset status_ip_rule_exist
unset status_adjust_traffic_policy
}
Expand Down Expand Up @@ -1083,7 +1089,6 @@ lz_get_policy_mode_status() {
## 返回值:
## status_route_hardware_type--路由器硬件类型,全局常量
## status_route_os_name--路由器操作系统名称,全局常量
## status_route_local_ip--路由器本地IP地址,全局变量
lz_get_route_status_info() {
echo "$(lzdate)" [$$]: --------------------------------------------- | tee -ai "${STATUS_LOG}" 2> /dev/null
## 路由器硬件类型
Expand Down Expand Up @@ -1277,7 +1282,6 @@ lz_get_route_status_info() {
local local_route_local_link_status="Unknown"
local local_route_local_encap="Unknown"
local local_route_local_mac="Unknown"
status_route_local_ip="Unknown"
local local_route_local_bcast_ip="Unknown"
local local_route_local_ip_mask="Unknown"

Expand All @@ -1295,7 +1299,6 @@ lz_get_route_status_info() {
[ -z "${local_route_local_mac}" ] && local_route_local_mac="Unknown"

## 获取路由器本地网络地址
status_route_local_ip="$( echo "${local_route_local_info}" | awk 'NR==2 {print $2}' | awk -F: '{print $2}' )"
[ -z "${status_route_local_ip}" ] && status_route_local_ip="Unknown"

## 获取路由器本地广播地址
Expand Down Expand Up @@ -1415,7 +1418,7 @@ lz_ss_support_status() {
## 1--未注册
lz_get_service_event_interface_status() {
if [ ! -f "${1}" ] || [ ! -f "${2}" ]; then return "1"; fi;
! grep -q "^[[:space:]]*$( lz_format_filename_regular_expression_string "${2}" )[[:space:]]\+\$[\{]@[\}][[:space:]]\+[\&]" "${1}" && return "1"
! grep -q "^[[:space:]]*$( lz_format_filename_regular_expression_string "${2}" )[[:space:]]\+\$[\{]@[\}][[:space:]]\+" "${1}" && return "1"
return "0"
}

Expand Down
4 changes: 2 additions & 2 deletions source_codes/lz/func/lz_vpn_daemon.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_vpn_daemon.sh v4.2.1
# lz_vpn_daemon.sh v4.2.2
# By LZ 妙妙呜 ([email protected])

## 虚拟专网客户端路由刷新处理后台守护进程脚本
Expand All @@ -9,7 +9,7 @@

#BEIGIN
## 版本号
LZ_VERSION=v4.2.1
LZ_VERSION=v4.2.2

## 项目接口文件部署路径
PATH_INTERFACE="${0%/*}"
Expand Down
Loading

0 comments on commit 0f2e706

Please sign in to comment.