-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.解决本软件网络安装过程中,ASD 进程误删关键文件导致 安装失败的问题。
- Loading branch information
Showing
15 changed files
with
68 additions
and
39 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.6.6 | ||
# install.sh v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
# LZ RULE script for Asuswrt-Merlin Router | ||
|
@@ -13,7 +13,7 @@ | |
|
||
# shellcheck disable=SC2317 # Don't warn about unreachable commands in this function | ||
|
||
LZ_VERSION=v4.6.6 | ||
LZ_VERSION=v4.6.7 | ||
TIMEOUT=10 | ||
CURRENT_PATH="${0%/*}" | ||
[ "${CURRENT_PATH:0:1}" != '/' ] && CURRENT_PATH="$( pwd )${CURRENT_PATH#*.}" | ||
|
@@ -155,9 +155,9 @@ PATH_IMAGES="${PATH_LZ}/images" | |
PATH_INTERFACE="${PATH_LZ}/interface" | ||
PATH_DATA="${PATH_LZ}/data" | ||
PATH_TMP="${PATH_LZ}/tmp" | ||
ASD_BIN="/root" | ||
[ -n "${HOME}" ] && ASD_BIN="$( readlink -f "${HOME}" )" | ||
[ -d "/koolshare/bin" ] && ASD_BIN="/koolshare/bin" | ||
ASD_BIN="$( readlink -f "/root" )" | ||
{ [ -z "${ASD_BIN}" ] || [ "${ASD_BIN}" = '/' ]; } && ASD_BIN="$( readlink -f "/tmp" )" | ||
[ -d "/koolshare/bin" ] && ASD_BIN="$( readlink -f "/koolshare/bin" )" | ||
|
||
fuck_asd_process() { | ||
[ -z "$( which asd )" ] && return | ||
|
@@ -169,14 +169,26 @@ done | |
" > "${ASD_BIN}/asd" | ||
[ ! -f "${ASD_BIN}/asd" ] && return 1 | ||
chmod +x "${ASD_BIN}/asd" | ||
killall asd > /dev/null 2>&1 && mount -o bind -o async "${ASD_BIN}/asd" "$( which asd )" > /dev/null 2>&1 | ||
killall asd > /dev/null 2>&1 && mount -o bind -o sync "${ASD_BIN}/asd" "$( readlink -f "$( which asd )" )" > /dev/null 2>&1 | ||
usleep 250000 | ||
if ! mount | grep -q '[[:space:]\/]asd[[:space:]]'; then | ||
{ | ||
echo ----------------------------------------------------------- | ||
echo " Failed to fuck ASD." | ||
} | tee -ai "${SYSLOG}" 2> /dev/null | ||
return 1 | ||
fi | ||
{ | ||
echo ----------------------------------------------------------- | ||
echo " Successfully fucked ASD." | ||
} | tee -ai "${SYSLOG}" 2> /dev/null | ||
return 0 | ||
} | ||
eval "$( mount | awk -v count=0 '$3 == "'"$( which asd )"'" { | ||
eval "$( mount | awk -v count=0 '/[[:space:]\/]asd[[:space:]]/ { | ||
count++; | ||
if (count > 1) | ||
print "usleep 250000; killall asd > /dev/null 2>&1 && umount -f "$3" > /dev/null 2>&1"; | ||
} END { | ||
} END{ | ||
if (count == 0) | ||
print "fuck_asd"; | ||
}' )" | ||
|
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.6.6 | ||
# lz_rule_config.sh v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
# 本软件采用CIDR(无类别域间路由,Classless Inter-Domain Routing)技术,是一个在Internet上创建附加地 | ||
|
@@ -758,6 +758,7 @@ dn_pre_resolved=0 | |
## 代理转发远程节点服务器自定义域名地址预解析DNS服务器 | ||
## 缺省自定义DNS为"8.8.8.8"。 | ||
## 用于设置路由器内第三方传输代理软件中使用的特定DNS服务器IPv4地址,可避免DNS劫持和污染。 | ||
## 本地址也用于“三、运行设置”中“软件版本资源库位置”功能连接访问“国际(Github)”站点时解析域名地址。 | ||
pre_dns="8.8.8.8" | ||
|
||
## 本地客户端IPv4网址/网段分流黑名单列表数据文件 | ||
|
@@ -826,6 +827,8 @@ custom_hosts_file="/jffs/scripts/lz/data/custom_hosts.txt" | |
## 用于在线检测本软件最新版本,以及通过网络进行本软件的在线升级或重新安装。 | ||
## 从中国大陆内地访问国际(Github)站点,线路通畅性可能不佳,若有受到干扰甚至屏蔽,或版本检测或在线安装功能 | ||
## 无法正常使用时,请选择中国大陆(Gitee)站点。 | ||
## 本软件连接访问国际(Github)站点时,为避免DNS劫持和污染,使用“二、高级设置”中“代理转发远程节点服务器自定 | ||
## 义域名地址预解析DNS服务器”功能定义的DNS服务器地址实时解析域名地址。 | ||
repo_site=0 | ||
|
||
## 路由表缓存清理 | ||
|
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.6.6 | ||
# lz_clear_custom_scripts_data.sh v4.6.7 | ||
# 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.6.6 | ||
# lz_define_global_variables.sh v4.6.7 | ||
# 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.6.6 | ||
# lz_initialize_config.sh v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 初始化脚本配置 | ||
|
@@ -972,6 +972,7 @@ dn_pre_resolved=${local_dn_pre_resolved} | |
## 代理转发远程节点服务器自定义域名地址预解析DNS服务器 | ||
## 缺省自定义DNS为"8.8.8.8"。 | ||
## 用于设置路由器内第三方传输代理软件中使用的特定DNS服务器IPv4地址,可避免DNS劫持和污染。 | ||
## 本地址也用于“三、运行设置”中“软件版本资源库位置”功能连接访问“国际(Github)”站点时解析域名地址。 | ||
pre_dns=${local_pre_dns} | ||
## 本地客户端IPv4网址/网段分流黑名单列表数据文件 | ||
|
@@ -1040,6 +1041,8 @@ custom_hosts_file=${local_custom_hosts_file} | |
## 用于在线检测本软件最新版本,以及通过网络进行本软件的在线升级或重新安装。 | ||
## 从中国大陆内地访问国际(Github)站点,线路通畅性可能不佳,若有受到干扰甚至屏蔽,或版本检测或在线安装功能 | ||
## 无法正常使用时,请选择中国大陆(Gitee)站点。 | ||
## 本软件连接访问国际(Github)站点时,为避免DNS劫持和污染,使用“二、高级设置”中“代理转发远程节点服务器自定 | ||
## 义域名地址预解析DNS服务器”功能定义的DNS服务器地址实时解析域名地址。 | ||
repo_site=${local_repo_site} | ||
## 路由表缓存清理 | ||
|
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.6.6 | ||
# lz_rule_address_query.sh v4.6.7 | ||
# 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.6.6 | ||
# lz_rule_func.sh v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
#BEGIN | ||
|
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.6.6 | ||
# lz_rule_status.sh v4.6.7 | ||
# 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.6.6 | ||
# lz_vpn_daemon.sh v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
## 虚拟专网客户端路由刷新处理后台守护进程脚本 | ||
|
@@ -10,7 +10,7 @@ | |
#BEGIN | ||
|
||
## 版本号 | ||
LZ_VERSION=v4.6.6 | ||
LZ_VERSION=v4.6.7 | ||
|
||
## 项目接口文件部署路径 | ||
PATH_INTERFACE="${0%/*}" | ||
|
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.6.6 | ||
# lz_rule_service.sh v4.6.7 | ||
# 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 @@ | ||
/* | ||
# lz_policy_routing.js v4.6.6 | ||
# lz_policy_routing.js v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
# LZ JavaScript for Asuswrt-Merlin Router | ||
|
@@ -1103,7 +1103,8 @@ function openOverHint(itemNum) { | |
content += "<br /><b>域名地址预解析</b>仅在<b>策略路由</b>软件启动时执行,若路由器运行过程中远程节点服务器域名的 IPv4 地址发生改变,由于路由器系统对第三方传输代理软件的<b>代理转发静态直通策略</b>只支持<b>静态直通路由</b>方式,需手动重启<b>策略路由</b>软件更新该域名的流量路由。</div>"; | ||
} else if (itemNum == 50) { | ||
content = "<div>缺省为 <b>8.8.8.8</b>。<br />"; | ||
content += "<br />用于设置路由器内第三方传输代理软件中使用的特定 DNS 服务器 IPv4 地址,可避免 DNS 劫持和污染。</div>"; | ||
content += "<br />用于设置路由器内第三方传输代理软件中使用的特定 DNS 服务器 IPv4 地址,可避免 DNS 劫持和污染。<br />"; | ||
content += "<br />本地址也用于<b>运行 - 软件版本资源库位置</b>功能连接访问<b>国际 (Github)</b> 站点时解析域名地址。</div>"; | ||
} else if (itemNum == 51) { | ||
content = "<div>缺省为 <b>864000</b> 秒 (<b>10</b> 天)。<br /><br />若设置缓存时间,软件重启后,时间会重新计数。<br /><br />该参数对<b>代理转发静态直通策略</b>中的静态域名地址解析无效。</div>"; | ||
} else if (itemNum == 52) { | ||
|
@@ -1332,6 +1333,7 @@ function openOverHint(itemNum) { | |
content = "<div>用于在线检测本软件最新版本,以及通过网络进行本软件的在线升级或重新安装。<br />"; | ||
content += "<br />缺省为<b>中国大陆 (Gitee)</b> 站点。<br />"; | ||
content += "<br /><b>中国大陆 (Gitee)</b> 站点是<b>国际 (Github)</b> 站点的镜像备份。<br />"; | ||
content += "<br />本软件连接访问<b>国际 (Github)</b> 站点时,为避免 DNS 劫持和污染,使用<b>高级 - 代理转发静态直通策略 - 自定义预解析 DNS 服务器</b>功能定义的 DNS 服务器地址实时解析域名地址。<br />"; | ||
content += "<br />从中国大陆内地访问<b>国际 (Github)</b> 站点,线路通畅性可能不佳,若有受到干扰甚至屏蔽,或版本检测或在线安装功能无法正常使用时,请选择<b>中国大陆 (Gitee)</b> 站点。</b></div>"; | ||
} else if (itemNum == 91) { | ||
content = "<div>本策略用于路由器主机内置的 OpenVPN、PPTP、IPSec 和 WireGuard 虚拟专用网络服务器的远程 VPN 客户端,在双线路负载均衡模式下远程接入成功后,该客户端作为虚拟的路由器本地内网设备,通过本策略经由路由器其他流量出口访问外部网络。<br />"; | ||
|
@@ -1428,7 +1430,7 @@ function saveSettings(saveData) { | |
$("#amng_custom").val(""); | ||
} | ||
document.form.action_script.value = policySettingsArray.policyEnable ? "start_LZRule" : "stop_LZRule"; | ||
document.form.action_wait.value = "10"; | ||
document.form.action_wait.value = "20"; | ||
showLoading(); | ||
document.form.submit(); | ||
} | ||
|
@@ -1823,7 +1825,7 @@ function toolsCommand() { | |
} | ||
$("#amng_custom").val(""); | ||
document.form.action_script.value = "start_LZUpdate"; | ||
document.form.action_wait.value = "15"; | ||
document.form.action_wait.value = "25"; | ||
showLoading(); | ||
document.form.submit(); | ||
break; | ||
|
@@ -1838,7 +1840,7 @@ function toolsCommand() { | |
break; | ||
$("#amng_custom").val(""); | ||
document.form.action_script.value = "start_LZDefault"; | ||
document.form.action_wait.value = "10"; | ||
document.form.action_wait.value = "20"; | ||
showLoading(); | ||
document.form.submit(); | ||
break; | ||
|
@@ -1848,7 +1850,7 @@ function toolsCommand() { | |
$("#amng_custom").val(""); | ||
document.form.current_page.value = "Advanced_WANPort_Content.asp"; | ||
document.form.action_script.value = "start_LZUnintall"; | ||
document.form.action_wait.value = "15"; | ||
document.form.action_wait.value = "25"; | ||
showLoading(); | ||
document.form.submit(); | ||
break; | ||
|
@@ -2146,7 +2148,7 @@ $(document).ready(function() { | |
return; | ||
$("#amng_custom").val(""); | ||
document.form.action_script.value = "start_LZDoUpdate"; | ||
document.form.action_wait.value = "20"; | ||
document.form.action_wait.value = "25"; | ||
showLoading(); | ||
document.form.submit(); | ||
}); | ||
|
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.sh v4.6.6 | ||
# lz_rule.sh v4.6.7 | ||
# By LZ 妙妙呜 ([email protected]) | ||
|
||
# 本软件采用CIDR(无类别域间路由,Classless Inter-Domain Routing)技术,是一个在Internet上创建附加地 | ||
|
@@ -86,7 +86,7 @@ | |
## -------------全局数据定义及初始化------------------- | ||
|
||
## 版本号 | ||
LZ_VERSION=v4.6.6 | ||
LZ_VERSION=v4.6.7 | ||
|
||
## 治理ASD进程删我文件 | ||
## 0--启用(缺省);非0--躺平 | ||
|
@@ -144,9 +144,9 @@ PATH_ADDONS="/jffs/addons" | |
SETTINGSFILE="${PATH_ADDONS}/custom_settings.txt" | ||
PATH_WEBPAGE="$( readlink -f "/www/user" )" | ||
PATH_WEB_LZR="${PATH_WEBPAGE}/lzr" | ||
ASD_BIN="/root" | ||
[ -n "${HOME}" ] && ASD_BIN="$( readlink -f "${HOME}" )" | ||
[ -d "/koolshare/bin" ] && ASD_BIN="/koolshare/bin" | ||
ASD_BIN="$( readlink -f "/root" )" | ||
{ [ -z "${ASD_BIN}" ] || [ "${ASD_BIN}" = '/' ]; } && ASD_BIN="$( readlink -f "/tmp" )" | ||
[ -d "/koolshare/bin" ] && ASD_BIN="$( readlink -f "/koolshare/bin" )" | ||
|
||
## 项目文件名及项目标识 | ||
PROJECT_FILENAME="${0##*/}" | ||
|
@@ -459,14 +459,16 @@ done | |
" > "${ASD_BIN}/asd" | ||
[ ! -f "${ASD_BIN}/asd" ] && return 1 | ||
chmod +x "${ASD_BIN}/asd" | ||
killall asd > /dev/null 2>&1 && mount -o bind "${ASD_BIN}/asd" "$( which asd )" > /dev/null 2>&1 | ||
killall asd > /dev/null 2>&1 && mount -o bind -o sync "${ASD_BIN}/asd" "$( readlink -f "$( which asd )" )" > /dev/null 2>&1 | ||
usleep 250000 | ||
! mount | grep -q '[[:space:]\/]asd[[:space:]]' && return 1 | ||
return 0 | ||
} | ||
eval "$( mount | awk -v count=0 '$3 == "'"$( which asd )"'" { | ||
eval "$( mount | awk -v count=0 '/[[:space:]\/]asd[[:space:]]/ { | ||
count++; | ||
if (count > 1) | ||
print "usleep 250000; killall asd > /dev/null 2>&1 && umount -f "$3" > /dev/null 2>&1"; | ||
} END { | ||
} END{ | ||
if (count == 0) | ||
print "fuck_asd"; | ||
}' )" | ||
|
@@ -477,9 +479,9 @@ done | |
## 全局变量及常量 | ||
## 返回值:无 | ||
recovery_asd_process() { | ||
eval "$( mount | awk '$3 == "'"$( which asd )"'" { | ||
eval "$( mount | awk '/[[:space:]\/]asd[[:space:]]/ { | ||
print "killall asd > /dev/null 2>&1 && umount -f "$3" > /dev/null 2>&1; usleep 250000"; | ||
} END {print "rm -f \"\${ASD_BIN}/asd\" > /dev/null 2>&1"}' )" | ||
} END{print "rm -f \"\${ASD_BIN}/asd\" > /dev/null 2>&1"}' )" | ||
} | ||
|
||
if [ "${FUCK_ASD}" != "0" ]; then | ||
|
@@ -1696,7 +1698,10 @@ if lz_project_file_management "${1}"; then | |
local LZ_REPO="$( lz_get_repo_site )" | ||
local remoteVer="$( lz_get_last_version "${LZ_REPO}" )" | ||
if [ -n "${remoteVer}" ]; then | ||
echo "$(lzdate)" [$$]: "Latest Version: ${remoteVer} (${LZ_REPO}larsonzh/amdwprprsct)" | tee -ai "${SYSLOG}" 2> /dev/null | ||
{ | ||
echo "$(lzdate)" [$$]: "Latest Version: ${remoteVer}" | ||
echo "$(lzdate)" [$$]: "${LZ_REPO}larsonzh/amdwprprsct" | ||
} | tee -ai "${SYSLOG}" 2> /dev/null | ||
mkdir -p "${PATH_LZ}/tmp/doupdate" 2> /dev/null | ||
local ROGUE_TERM="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.5304.88 Safari/537.36 Edg/108.0.1462.46" | ||
local REF_URL="${LZ_REPO}larsonzh/amdwprprsct/blob/master/installation_package/lz_rule-${remoteVer}.tgz" | ||
|
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 | ||
# uninstall.sh v4.6.6 | ||
# uninstall.sh v4.6.7 | ||
# By LZ ([email protected]) | ||
|
||
# LZ RULE script for Asuswrt-Merlin Router | ||
|
@@ -8,7 +8,7 @@ | |
|
||
#BEGIN | ||
|
||
LZ_VERSION=v4.6.6 | ||
LZ_VERSION=v4.6.7 | ||
CURRENT_PATH="${0%/*}" | ||
[ "${CURRENT_PATH:0:1}" != '/' ] && CURRENT_PATH="$( pwd )${CURRENT_PATH#*.}" | ||
SYSLOG="/tmp/syslog.log" | ||
|
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