-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.优化双线路负载均衡模式下路由器重启时,PPPoE 连接失败后的一次性自动重拨恢复机制,最大限度 地保证设备非故障状态下的线路畅通。 2.完善前后台任务执行过程中的同步机制。 3.更新运营商 IP 地址数据文件。
- Loading branch information
Showing
20 changed files
with
129 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# install.sh v4.1.1 | ||
# install.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
# LZ RULE script for Asuswrt-Merlin Router | ||
|
@@ -11,7 +11,7 @@ | |
|
||
#BEIGIN | ||
|
||
LZ_VERSION=v4.1.1 | ||
LZ_VERSION=v4.1.2 | ||
TIMEOUT=10 | ||
CURRENT_PATH="${0%/*}" | ||
[ "${CURRENT_PATH:0:1}" != '/' ] && CURRENT_PATH="$( pwd )${CURRENT_PATH#*.}" | ||
|
@@ -240,9 +240,9 @@ EOF_SERVICE_INTERFACE | |
&& sed -i 'l1 s:^.*\(#!/bin/sh.*$\):\1/g' "/jffs/scripts/service-event" | ||
fi | ||
sed -i -e '/lz_rule[\.]sh/d' -e '/lz_update_ispip_data[\.]sh/d' -e '/lz_rule_service[\.]sh/d' "/jffs/scripts/service-event" | ||
sed -i -e "\$a ${PATH_INTERFACE}/lz_rule_service.sh \"\$\{1\}\" \"\$\{2\}\" # Added by LZRule" -e "/^[ \t]*$/d" "/jffs/scripts/service-event" | ||
sed -i -e "\$a ${PATH_INTERFACE}/lz_rule_service.sh \$\{@\} # Added by LZRule" -e "/^[ \t]*$/d" "/jffs/scripts/service-event" | ||
chmod +x "/jffs/scripts/service-event" | ||
! grep -q "${PATH_INTERFACE}/lz_rule_service[\.]sh \"\$[\{]1[\}]\" \"\$[\{]2[\}]\"" "/jffs/scripts/service-event" && return "1" | ||
! grep -q "${PATH_INTERFACE}/lz_rule_service[\.]sh \$[\{]@[\}]" "/jffs/scripts/service-event" && return "1" | ||
return "0" | ||
} | ||
|
||
|
@@ -309,6 +309,7 @@ lz_mount_web_ui() { | |
ln -s "${PATH_TMP}/address.log" "${PATH_WEB_LZR}/LZRAddress.html" > /dev/null 2>&1 | ||
ln -s "${PATH_TMP}/crontab.log" "${PATH_WEB_LZR}/LZRCrontab.html" > /dev/null 2>&1 | ||
ln -s "${PATH_TMP}/unlock.log" "${PATH_WEB_LZR}/LZRUnlock.html" > /dev/null 2>&1 | ||
ln -s "/var/lock/lz_rule_instance.lock" "${PATH_WEB_LZR}/LZRInstance.html" > /dev/null 2>&1 | ||
! which md5sum > /dev/null 2>&1 && break | ||
local page_name="$( lz_get_webui_page )" | ||
[ -z "${page_name}" ] && break | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_rule_config.sh v4.1.1 | ||
# lz_rule_config.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
# 本软件采用CIDR(无类别域间路由,Classless Inter-Domain Routing)技术,是一个在Internet上创建附加地 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_clear_custom_scripts_data.sh v4.1.1 | ||
# lz_clear_custom_scripts_data.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 清除用户自定义脚本数据 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_define_global_variables.sh v4.1.1 | ||
# lz_define_global_variables.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
# QnkgTFog5aaZ5aaZ5ZGc77yI6Juk6J+G5aKp5YS/77yJ(首次运行标识,切勿修改) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_initialize_config.sh v4.1.1 | ||
# lz_initialize_config.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 初始化脚本配置 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_rule_address_query.sh v4.1.1 | ||
# lz_rule_address_query.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 网址信息查询脚本 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_rule_func.sh v4.1.1 | ||
# lz_rule_func.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
#BEIGIN | ||
|
@@ -5255,12 +5255,14 @@ lz_deployment_routing_policy() { | |
[ -z "${local_info}" ] && echo "$(lzdate)" [$$]: --------------------------------------------- | tee -ai "${SYSLOG}" 2> /dev/null | ||
echo "$(lzdate)" [$$]: Primary WAN \( "${iptv_wan0_ifname}" "${iptv_wan0_pppoe_ifname}" \) fault. | tee -ai "${SYSLOG}" 2> /dev/null | ||
local_info="1" | ||
restart_ppp0="0" | ||
} | ||
[ -n "${iptv_wan0_pppoe_ifname}" ] \ | ||
&& ! lz_show_routing_table "${rt_wan1}" | awk '$1 == "default" && $5 == "'"${iptv_wan0_pppoe_ifname}"'" {exit(1)}' && { | ||
[ -z "${local_info}" ] && echo "$(lzdate)" [$$]: --------------------------------------------- | tee -ai "${SYSLOG}" 2> /dev/null | ||
echo "$(lzdate)" [$$]: Primary WAN \( "${iptv_wan0_pppoe_ifname}" \) fault. | tee -ai "${SYSLOG}" 2> /dev/null | ||
local_info="1" | ||
restart_ppp0="0" | ||
} | ||
if [ -z "${iptv_wan1_ifname}" ]; then | ||
[ -z "${local_info}" ] && echo "$(lzdate)" [$$]: --------------------------------------------- | tee -ai "${SYSLOG}" 2> /dev/null | ||
|
@@ -5278,12 +5280,14 @@ lz_deployment_routing_policy() { | |
[ -z "${local_info}" ] && echo "$(lzdate)" [$$]: --------------------------------------------- | tee -ai "${SYSLOG}" 2> /dev/null | ||
echo "$(lzdate)" [$$]: Secondary WAN \( "${iptv_wan1_ifname}" "${iptv_wan1_pppoe_ifname}" \) fault. | tee -ai "${SYSLOG}" 2> /dev/null | ||
local_info="1" | ||
restart_ppp1="1" | ||
} | ||
[ -n "${iptv_wan1_pppoe_ifname}" ] \ | ||
&& ! lz_show_routing_table "${rt_wan0}" | awk '$1 == "default" && $5 == "'"${iptv_wan1_pppoe_ifname}"'" {exit(1)}' && { | ||
[ -z "${local_info}" ] && echo "$(lzdate)" [$$]: --------------------------------------------- | tee -ai "${SYSLOG}" 2> /dev/null | ||
echo "$(lzdate)" [$$]: Secondary WAN \( "${iptv_wan1_pppoe_ifname}" \) fault. | tee -ai "${SYSLOG}" 2> /dev/null | ||
local_info="1" | ||
restart_ppp1="1" | ||
} | ||
|
||
## 获取IPTV接口ID标识和网关地址 | ||
|
@@ -5893,7 +5897,7 @@ lz_start_single_net_iptv_box_services() { | |
local rt_main="$( ip route show )" | ||
|
||
local local_info= | ||
local local_ppp_fault="none" | ||
local local_ppp0_fault="none" local_ppp1_fault="none" | ||
[ -n "${iptv_wan0_ifname}" ] && [ -n "${iptv_wan1_ifname}" ] \ | ||
&& ! lz_show_routing_table "${rt_main}" | awk '$1 == "default" && $5 == "'"${iptv_wan0_ifname}"'" {exit(1)}' \ | ||
&& ! lz_show_routing_table "${rt_main}" | awk '$1 == "default" && $5 == "'"${iptv_wan1_ifname}"'" {exit(1)}' && { | ||
|
@@ -5919,7 +5923,7 @@ lz_start_single_net_iptv_box_services() { | |
&& ! lz_show_routing_table "${rt_main}" | awk '$1 == "default" && $5 == "'"${iptv_wan0_ifname}"'" {exit(1)}' \ | ||
&& lz_show_routing_table "${rt_main}" | awk '$1 == "default" && $5 == "'"${iptv_wan0_pppoe_ifname}"'" {exit(1)}' \ | ||
&& local_info="1" \ | ||
&& local_ppp_fault="0" \ | ||
&& local_ppp0_fault="0" \ | ||
&& echo "$(lzdate)" [$$]: Primary WAN \( "${iptv_wan0_pppoe_ifname}" \) PPPoE fault. | tee -ai "${SYSLOG}" 2> /dev/null | ||
if [ "$( nvram get "wan1_enable" )" = "1" ] && ! nvram get "wans_dualwan" | grep -qw "none"; then | ||
[ -z "${iptv_wan1_ifname}" ] && { | ||
|
@@ -5940,14 +5944,15 @@ lz_start_single_net_iptv_box_services() { | |
&& ! lz_show_routing_table "${rt_main}" | awk '$1 == "default" && $5 == "'"${iptv_wan1_ifname}"'" {exit(1)}' \ | ||
&& lz_show_routing_table "${rt_main}" | awk '$1 == "default" && $5 == "'"${iptv_wan1_pppoe_ifname}"'" {exit(1)}' \ | ||
&& local_info="1" \ | ||
&& local_ppp_fault="1" \ | ||
&& local_ppp1_fault="1" \ | ||
&& echo "$(lzdate)" [$$]: Secondary WAN \( "${iptv_wan1_pppoe_ifname}" \) PPPoE fault. | tee -ai "${SYSLOG}" 2> /dev/null | ||
[ "$( nvram get "wans_mode" )" = "lb" ] \ | ||
&& [ "$( nvram get "wan0_enable" )" = "1" ] && [ "$( nvram get "wan1_enable" )" = "1" ] \ | ||
&& [ -n "$( nvram get "wan0_proto_t" )" ] && [ -n "$( nvram get "wan1_proto_t" )" ] \ | ||
&& local_info="1" \ | ||
&& { | ||
[ "${local_ppp_fault}" != "none" ] && restart_pppoe="${local_ppp_fault}" | ||
[ "${local_ppp0_fault}" != "none" ] && restart_ppp0="${local_ppp0_fault}" | ||
[ "${local_ppp1_fault}" != "none" ] && restart_ppp1="${local_ppp1_fault}" | ||
echo "$(lzdate)" [$$]: Dual WAN \( "$( nvram get "wan0_proto" )" -- "$( nvram get "wan1_proto" )" \) startup failed. | tee -ai "${SYSLOG}" 2> /dev/null | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_rule_status.sh v4.1.1 | ||
# lz_rule_status.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 显示脚本运行状态脚本 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_vpn_daemon.sh v4.1.1 | ||
# lz_vpn_daemon.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 虚拟专网客户端路由刷新处理后台守护进程脚本 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# lz_rule_service.sh v4.1.1 | ||
# lz_rule_service.sh v4.1.2 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 服务接口脚本 | ||
|
@@ -47,11 +47,11 @@ case "${2}" in | |
printf "\nTotal: %s\n" "${count}" >> "${PATH_LZ}/tmp/routing.log" | ||
;; | ||
LZRtRules) | ||
ip rule show | awk 'BEGIN{system("printf \"%s %s \n\n\" \"$( date +\"%F %T\")\" \"[$$]:\"")} \ | ||
ip rule show | awk -v pid="[${$}]:" 'BEGIN{system("printf \"%s %s \n\n\" \"$( date +\"%F %T\")\" "pid)} \ | ||
{print $0} END{printf "\nTotal: %s\n", NR}' > "${PATH_LZ}/tmp/rules.log" | ||
;; | ||
LZCrontab) | ||
crontab -l | awk 'BEGIN{system("printf \"%s %s \n\n\" \"$( date +\"%F %T\")\" \"[$$]:\"")} {print $0} END{printf "\nTotal: %s\n", NR}' > "${PATH_LZ}/tmp/crontab.log" | ||
crontab -l | awk -v pid="[${$}]:" 'BEGIN{system("printf \"%s %s \n\n\" \"$( date +\"%F %T\")\" "pid)} {print $0} END{printf "\nTotal: %s\n", NR}' > "${PATH_LZ}/tmp/crontab.log" | ||
;; | ||
LZUpdate) | ||
[ -f "${PATH_LZ}/lz_update_ispip_data.sh" ] && "${PATH_LZ}/lz_update_ispip_data.sh" | ||
|
Oops, something went wrong.