Skip to content

Commit

Permalink
v4.4.3
Browse files Browse the repository at this point in the history
1.优化代码。
2.更新运营商 IP 地址数据文件。
  • Loading branch information
larsonzh committed Jun 9, 2024
1 parent 2a7a132 commit 2d93f4e
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 45 deletions.
4 changes: 2 additions & 2 deletions source_codes/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# install.sh v4.4.2
# install.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

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

#BEGIN

LZ_VERSION=v4.4.2
LZ_VERSION=v4.4.3
TIMEOUT=10
CURRENT_PATH="${0%/*}"
[ "${CURRENT_PATH:0:1}" != '/' ] && CURRENT_PATH="$( pwd )${CURRENT_PATH#*.}"
Expand Down
4 changes: 4 additions & 0 deletions source_codes/lz/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v4.4.3 (2024/6/10)
1.优化代码。
2.更新运营商 IP 地址数据文件。

v4.4.2 (2024/6/7)
1.优化和升级配置文件数据批量读写算法。
2.完善定时自动更新运营商 IP 地址数据文件控制逻辑。
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.4.2
# lz_rule_config.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

# 本软件采用CIDR(无类别域间路由,Classless Inter-Domain Routing)技术,是一个在Internet上创建附加地
Expand Down
1 change: 0 additions & 1 deletion source_codes/lz/data/lz_hk_cidr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@
103.127.80.0/22
103.127.128.0/24
103.127.248.0/22
103.129.196.0/22
103.129.252.0/22
103.130.200.0/24
103.131.34.0/24
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.4.2
# lz_clear_custom_scripts_data.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

## 清除用户自定义脚本数据
Expand Down
2 changes: 1 addition & 1 deletion 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.4.2
# lz_define_global_variables.sh v4.4.3
# By LZ 妙妙呜 ([email protected])
# QnkgTFog5aaZ5aaZ5ZGc77yI6Juk6J+G5aKp5YS/77yJ(首次运行标识,切勿修改)

Expand Down
49 changes: 21 additions & 28 deletions 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.4.2
# lz_initialize_config.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

## 初始化脚本配置
Expand Down Expand Up @@ -33,11 +33,8 @@ lz_variable_initialize() {
## 返回值:无
lz_variable_uninitialize() {
eval "$( echo "${param_list}" | sed "s/^[[:alnum:]_][[:alnum:]_]*$/unset local_& local_ini_& local_&_changed local_&_flag/g" )"
unset local_default
unset local_changed
unset local_reinstall
unset dnsmasq_enable
unset param_list param_default_list ini_param_default_list
unset local_default local_changed local_reinstall dnsmasq_enable
}

## 初始化配置参数函数
Expand Down Expand Up @@ -160,10 +157,9 @@ lz_init_cfg_data() {
## 全局变量
## 返回值:无
lz_fix_lost_data() {
eval "$( echo "${param_list}" | sed -n "/^all_foreign_wan_port$/,/^custom_dualwan_scripts_filename$/{
s/^[[:alnum:]_][[:alnum:]_]*$/[ ! \"\${local_&_flag}\" ] \&\& local_&=\"\${local_ini_&}\"/g;
p
}" )"
eval "$( eval "$( echo "${param_list}" | sed -n "/^all_foreign_wan_port$/,/^custom_dualwan_scripts_filename$/{
s/^[[:alnum:]_][[:alnum:]_]*$/echo \"& \${local_&_flag}\"/;p}" )" \
| awk '$2 != "1" {x++; print "local_"$1"=\"\${local_ini_"$1"}\"";}' )"
}

## 复原配置文件函数
Expand Down Expand Up @@ -1106,10 +1102,11 @@ lz_get_config_data() {
ini_param_default_list="$( eval "$( echo "${param_list}" \
| sed "s/^[[:alnum:]_][[:alnum:]_]*$/echo &=\"\${local_ini_&}\"/" )" \
| sed 's/\"//g' )"
eval "$( awk -F "=" -v param_default="${param_default_list}" -v ini_param_default="${ini_param_default_list}" -v str_buffer="" -v fname="${PATH_CONFIGS}/lz_rule_config.sh" \
eval "$( awk -F "=" -v param_default="${param_default_list}" -v ini_param_default="${ini_param_default_list}" -v dmq="${dnsmasq_enable}" -v fname="${PATH_CONFIGS}/lz_rule_config.sh" \
'BEGIN{
x=0;
count=0;
str_buffer="";
split(param_default, arr, "\n");
for (id in arr) {
pos=index(arr[id], "=");
Expand Down Expand Up @@ -1170,7 +1167,7 @@ lz_get_config_data() {
invalid=1;
} else if ($1 == "wan_1_domain" || $1 == "wan_2_domain") {
flag=1;
if (value !~ /^[0-9]$/ || (value == "0" && "'"${dnsmasq_enable//\"/}"'" != "0"))
if (value !~ /^[0-9]$/ || (value == "0" && dmq != "0"))
invalid=1;
} else if ($1 == "ruid_interval_day") {
flag=1;
Expand Down Expand Up @@ -1303,7 +1300,7 @@ lz_get_config_data() {
else if (invalid == 5)
str_buffer=str_buffer" -e \"s\|\^\[\[\:space\:\]\]\*"$1"=\.\*\$\|"$1"="value" ## 时间分钟数(0~59,\*表示由系统指定);\"ruid_timer_min=18\"表示更新当天的凌晨3点18分。\|\"";
print "local_"$1"="value;
print "local_"$1"_flag=s";
print "local_"$1"_flag=\"1\"";
count++;
} END{
param_total=length(i);
Expand Down Expand Up @@ -1394,11 +1391,12 @@ lz_get_box_data() {
ini_param_default_list="$( eval "$( echo "${param_list}" \
| sed "s/^[[:alnum:]_][[:alnum:]_]*$/echo &=\"\${local_ini_&}\"/" )" \
| sed 's/\"//g' )"
eval "$( awk -F "=" -v ini_param_default="${ini_param_default_list}" -v str_buffer="" -v fname="${PATH_CONFIGS}/lz_rule_config.box" \
eval "$( awk -F "=" -v ini_param_default="${ini_param_default_list}" -v dmq="${dnsmasq_enable}" -v fname="${PATH_CONFIGS}/lz_rule_config.box" \
'BEGIN{
count=0;
mark=0;
policymode=0;
str_buffer=""
split(ini_param_default, arr, "\n");
for (id in arr) {
pos=index(arr[id], "=");
Expand Down Expand Up @@ -1488,7 +1486,7 @@ lz_get_box_data() {
invalid=6;
} else if (key == "wan_1_domain" || key == "wan_2_domain") {
flag=1;
if (value !~ /^[0-9]$/ || (value == "0" && "'"${dnsmasq_enable//\"/}"'" != "0"))
if (value !~ /^[0-9]$/ || (value == "0" && dmq != "0"))
invalid=1;
} else if (key == "ruid_interval_day") {
flag=1;
Expand Down Expand Up @@ -1628,16 +1626,12 @@ lz_get_box_data() {
## 输入项:
## 全局常量及变量
## 返回值:
## 1--已改变
## 0--未改变
lz_cfg_is_changed() {
local local_cfg_changed="0"
## local_changed
lz_get_cfg_changed() {
eval "$( eval "$( echo "${param_list}" | sed -n "/^all_foreign_wan_port$/,/^custom_dualwan_scripts_filename$/{
s/^[[:alnum:]_][[:alnum:]_]*$/echo \"& \${local_ini_&} \${local_&}\"/;
p
}" )" | awk -v x="0" '$2 != $3 && NF != "0" {x++; print "local_"$1"_changed=\"1\"";} \
END{if (x > 0) print "local_cfg_changed=\"1\"";}' )"
return "${local_cfg_changed}"
s/^[[:alnum:]_][[:alnum:]_]*$/echo \"& \${local_ini_&} \${local_&}\"/;p}" )" \
| awk -v x="0" '$2 != $3 {x++; print "local_"$1"_changed=\"1\"";} \
END{if (x > 0) print "local_changed=\"1\"";}' )"
}

## 恢复原有配置数据函数
Expand All @@ -1646,8 +1640,8 @@ lz_cfg_is_changed() {
## 返回值:无
lz_restore_config() {
eval "$( eval "$( echo "${param_list}" | sed -n "/^all_foreign_wan_port$/,/^custom_dualwan_scripts_filename$/{
s/^[[:alnum:]_][[:alnum:]_]*$/echo \"& \${local_&_changed}\"/;p
}" )" | awk -v x="0" '$2 == "1" {
s/^[[:alnum:]_][[:alnum:]_]*$/echo \"& \${local_&_changed}\"/;p}" )" \
| awk -v x="0" '$2 == "1" {
x++;
if ($1 == "ruid_interval_day")
printf " -e \"s|^[[:space:]]\*%s=.*$|%s=\${local_ini_%s} ## 间隔天数(1~31);\"ruid_interval_day=5\"表示每隔5天。|\"",$1,$1,$1;
Expand Down Expand Up @@ -1962,9 +1956,8 @@ else
## 输入项:
## 全局常量及变量
## 返回值:
## 1--已改变
## 0--未改变
! lz_cfg_is_changed && local_changed="1"
## local_changed
lz_get_cfg_changed

[ "${local_ini_udpxy_used}" != "${local_udpxy_used}" ] && local_udpxy_used_changed="1"
if [ "${local_udpxy_used_changed}" = "1" ]; then
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.4.2
# lz_rule_address_query.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

## 网址信息查询脚本
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/func/lz_rule_func.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_rule_func.sh v4.4.2
# lz_rule_func.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

#BEGIN
Expand Down
2 changes: 1 addition & 1 deletion 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.4.2
# lz_rule_status.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

## 显示脚本运行状态脚本
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.4.2
# lz_vpn_daemon.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

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

## 版本号
LZ_VERSION=v4.4.2
LZ_VERSION=v4.4.3

## 项目接口文件部署路径
PATH_INTERFACE="${0%/*}"
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/interface/lz_rule_service.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_rule_service.sh v4.4.2
# lz_rule_service.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

## 服务接口脚本
Expand Down
2 changes: 1 addition & 1 deletion source_codes/lz/js/lz_policy_routing.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
# lz_policy_routing.js v4.4.2
# lz_policy_routing.js v4.4.3
# By LZ 妙妙呜 ([email protected])
# LZ JavaScript for Asuswrt-Merlin Router
Expand Down
4 changes: 2 additions & 2 deletions source_codes/lz/lz_rule.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# lz_rule.sh v4.4.2
# lz_rule.sh v4.4.3
# By LZ 妙妙呜 ([email protected])

# 本软件采用CIDR(无类别域间路由,Classless Inter-Domain Routing)技术,是一个在Internet上创建附加地
Expand Down Expand Up @@ -80,7 +80,7 @@
## -------------全局数据定义及初始化-------------------

## 版本号
LZ_VERSION=v4.4.2
LZ_VERSION=v4.4.3

## 运行状态查询命令
SHOW_STATUS="status"
Expand Down
4 changes: 2 additions & 2 deletions source_codes/lz/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# uninstall.sh v4.4.2
# uninstall.sh v4.4.3
# By LZ ([email protected])

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

#BEGIN

LZ_VERSION=v4.4.2
LZ_VERSION=v4.4.3
TIMEOUT=10
CURRENT_PATH="${0%/*}"
[ "${CURRENT_PATH:0:1}" != '/' ] && CURRENT_PATH="$( pwd )${CURRENT_PATH#*.}"
Expand Down

0 comments on commit 2d93f4e

Please sign in to comment.