Skip to content

Commit

Permalink
feat(脚本): 增加reality按照IP扫描可用域名
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Nov 13, 2023
1 parent 3f40cba commit 287f22d
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ mkdirTools() {
mkdir -p /etc/v2ray-agent/v2ray/conf
mkdir -p /etc/v2ray-agent/v2ray/tmp
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/hysteria/conf
mkdir -p /etc/systemd/system/
Expand Down Expand Up @@ -8218,6 +8219,7 @@ xrayCoreRealityInstall() {
# 生成账号
showAccounts 8
}

# reality管理
manageReality() {

Expand All @@ -8231,6 +8233,7 @@ manageReality() {
else
echoContent yellow "1.安装"
fi
echoContent yellow "4.扫描Reality域名"
echoContent red "=============================================================="
read -r -p "请选择:" installRealityStatus

Expand All @@ -8242,9 +8245,51 @@ manageReality() {
elif [[ "${installRealityStatus}" == "3" ]]; then
initXrayRealityConfig 1
updateXrayRealityConfig
elif [[ "${installRealityStatus}" == "4" ]]; then
installRealityScanner
realityScanner
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管理
manageHysteria() {
echoContent skyBlue "\n进度 1/1 : Hysteria2 管理"
Expand Down Expand Up @@ -8423,7 +8468,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
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 "描述:八合一共存脚本\c"
showInstallStatus
Expand Down

0 comments on commit 287f22d

Please sign in to comment.