mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 增加reality按照IP扫描可用域名
parent
3f40cba268
commit
287f22d4ec
47
install.sh
47
install.sh
|
@ -814,6 +814,7 @@ mkdirTools() {
|
||||||
mkdir -p /etc/v2ray-agent/v2ray/conf
|
mkdir -p /etc/v2ray-agent/v2ray/conf
|
||||||
mkdir -p /etc/v2ray-agent/v2ray/tmp
|
mkdir -p /etc/v2ray-agent/v2ray/tmp
|
||||||
mkdir -p /etc/v2ray-agent/xray/conf
|
mkdir -p /etc/v2ray-agent/xray/conf
|
||||||
|
mkdir -p /etc/v2ray-agent/xray/reality_scan
|
||||||
mkdir -p /etc/v2ray-agent/xray/tmp
|
mkdir -p /etc/v2ray-agent/xray/tmp
|
||||||
mkdir -p /etc/v2ray-agent/hysteria/conf
|
mkdir -p /etc/v2ray-agent/hysteria/conf
|
||||||
mkdir -p /etc/systemd/system/
|
mkdir -p /etc/systemd/system/
|
||||||
|
@ -8218,6 +8219,7 @@ xrayCoreRealityInstall() {
|
||||||
# 生成账号
|
# 生成账号
|
||||||
showAccounts 8
|
showAccounts 8
|
||||||
}
|
}
|
||||||
|
|
||||||
# reality管理
|
# reality管理
|
||||||
manageReality() {
|
manageReality() {
|
||||||
|
|
||||||
|
@ -8231,6 +8233,7 @@ manageReality() {
|
||||||
else
|
else
|
||||||
echoContent yellow "1.安装"
|
echoContent yellow "1.安装"
|
||||||
fi
|
fi
|
||||||
|
echoContent yellow "4.扫描Reality域名"
|
||||||
echoContent red "=============================================================="
|
echoContent red "=============================================================="
|
||||||
read -r -p "请选择:" installRealityStatus
|
read -r -p "请选择:" installRealityStatus
|
||||||
|
|
||||||
|
@ -8242,9 +8245,51 @@ manageReality() {
|
||||||
elif [[ "${installRealityStatus}" == "3" ]]; then
|
elif [[ "${installRealityStatus}" == "3" ]]; then
|
||||||
initXrayRealityConfig 1
|
initXrayRealityConfig 1
|
||||||
updateXrayRealityConfig
|
updateXrayRealityConfig
|
||||||
|
elif [[ "${installRealityStatus}" == "4" ]]; then
|
||||||
|
installRealityScanner
|
||||||
|
realityScanner
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
# 安装reality scanner
|
||||||
|
installRealityScanner() {
|
||||||
|
if [[ ! -f "/etc/v2ray-agent/xray/reality_scan/RealiTLScanner-linux-64" ]]; then
|
||||||
|
version=$(curl -s https://api.github.com/repos/XTLS/RealiTLScanner/releases?per_page=1 | jq -r '.[]|.tag_name')
|
||||||
|
wget -c -q -P /etc/v2ray-agent/xray/ "https://github.com/XTLS/RealiTLScanner/releases/download/${version}/RealiTLScanner-linux-64"
|
||||||
|
chmod 655 /etc/v2ray-agent/xray/reality_scan/RealiTLScanner-linux-64
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# reality scanner
|
||||||
|
realityScanner() {
|
||||||
|
echoContent skyBlue "\n进度 1/1 : 扫描Reality域名"
|
||||||
|
echoContent red "\n=============================================================="
|
||||||
|
echoContent yellow "# 注意事项"
|
||||||
|
echoContent yellow "扫描完成后,请自行检查扫描网站结果内容是否合规,需个人承担风险\n"
|
||||||
|
echoContent yellow "1.扫描IPv4"
|
||||||
|
echoContent yellow "2.扫描IPv6"
|
||||||
|
echoContent red "=============================================================="
|
||||||
|
read -r -p "请选择:" realityScannerStatus
|
||||||
|
local type=
|
||||||
|
if [[ "${realityScannerStatus}" == "1" ]]; then
|
||||||
|
type=4
|
||||||
|
elif [[ "${realityScannerStatus}" == "2" ]]; then
|
||||||
|
type=6
|
||||||
|
fi
|
||||||
|
|
||||||
|
publicIP=$(getPublicIP "${type}")
|
||||||
|
echoContent yellow "IP:${publicIP}"
|
||||||
|
if [[ -z "${publicIP}" ]]; then
|
||||||
|
echoContent red " ---> 无法获取IP"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -r -p "IP是否正确?[y/n]:" ipStatus
|
||||||
|
if [[ "${ipStatus}" == "y" ]]; then
|
||||||
|
echoContent yellow "结果存储在 /etc/v2ray-agent/xray/reality_scan/result.log 文件中\n"
|
||||||
|
/etc/v2ray-agent/xray/reality_scan/RealiTLScanner-linux-64 -addr "${publicIP}" | tee /etc/v2ray-agent/xray/reality_scan/result.log
|
||||||
|
else
|
||||||
|
echoContent red " ---> 无法读取正确IP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
# hysteria管理
|
# hysteria管理
|
||||||
manageHysteria() {
|
manageHysteria() {
|
||||||
echoContent skyBlue "\n进度 1/1 : Hysteria2 管理"
|
echoContent skyBlue "\n进度 1/1 : Hysteria2 管理"
|
||||||
|
@ -8423,7 +8468,7 @@ menu() {
|
||||||
cd "$HOME" || exit
|
cd "$HOME" || exit
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
echoContent green "作者:mack-a"
|
||||||
echoContent green "当前版本:v2.11.11"
|
echoContent green "当前版本:v2.11.12"
|
||||||
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:八合一共存脚本\c"
|
echoContent green "描述:八合一共存脚本\c"
|
||||||
showInstallStatus
|
showInstallStatus
|
||||||
|
|
Loading…
Reference in New Issue