feat(脚本): 增加快捷重新安装(读取上次配置)

dev
mack-a 2024-09-27 16:53:28 +08:00
parent f1e2708606
commit 795eb7a8f8
1 changed files with 125 additions and 69 deletions

View File

@ -321,6 +321,9 @@ initVar() {
addressWarpReg= addressWarpReg=
secretKeyWarpReg= secretKeyWarpReg=
# 上次安装配置状态
lastInstallationConfig=
} }
# 读取tls证书详情 # 读取tls证书详情
@ -484,6 +487,7 @@ readInstallProtocolType() {
currentInstallProtocolType="${currentInstallProtocolType}7," currentInstallProtocolType="${currentInstallProtocolType}7,"
if [[ "${coreInstallType}" == "1" ]]; then if [[ "${coreInstallType}" == "1" ]]; then
xrayVLESSRealityServerName=$(jq -r .inbounds[0].streamSettings.realitySettings.serverNames[0] "${row}.json") xrayVLESSRealityServerName=$(jq -r .inbounds[0].streamSettings.realitySettings.serverNames[0] "${row}.json")
realityServerName=${xrayVLESSRealityServerName}
xrayVLESSRealityPort=$(jq -r .inbounds[0].port "${row}.json") xrayVLESSRealityPort=$(jq -r .inbounds[0].port "${row}.json")
# xrayVLESSRealityPrivateKey=$(jq -r .inbounds[0].streamSettings.realitySettings.privateKey "${row}.json") # xrayVLESSRealityPrivateKey=$(jq -r .inbounds[0].streamSettings.realitySettings.privateKey "${row}.json")
# xrayVLESSRealityPublicKey=$(jq -r .inbounds[0].streamSettings.realitySettings.publicKey "${row}.json") # xrayVLESSRealityPublicKey=$(jq -r .inbounds[0].streamSettings.realitySettings.publicKey "${row}.json")
@ -494,6 +498,7 @@ readInstallProtocolType() {
frontingTypeReality=07_VLESS_vision_reality_inbounds frontingTypeReality=07_VLESS_vision_reality_inbounds
singBoxVLESSRealityVisionPort=$(jq -r .inbounds[0].listen_port "${row}.json") singBoxVLESSRealityVisionPort=$(jq -r .inbounds[0].listen_port "${row}.json")
singBoxVLESSRealityVisionServerName=$(jq -r .inbounds[0].tls.server_name "${row}.json") singBoxVLESSRealityVisionServerName=$(jq -r .inbounds[0].tls.server_name "${row}.json")
realityServerName=${singBoxVLESSRealityVisionServerName}
if [[ -f "${configPath}reality_key" ]]; then if [[ -f "${configPath}reality_key" ]]; then
singBoxVLESSRealityPublicKey=$(grep "publicKey" <"${configPath}reality_key" | awk -F "[:]" '{print $2}') singBoxVLESSRealityPublicKey=$(grep "publicKey" <"${configPath}reality_key" | awk -F "[:]" '{print $2}')
@ -754,6 +759,15 @@ readSingBoxConfig() {
fi fi
} }
# 读取上次安装的配置
readLastInstallationConfig() {
if [[ -n "${configPath}" ]]; then
read -r -p "读取到上次安装的配置,是否使用 [y/n]:" lastInstallationConfigStatus
if [[ "${lastInstallationConfigStatus}" == "y" ]]; then
lastInstallationConfig=true
fi
fi
}
# 卸载 sing-box # 卸载 sing-box
unInstallSingBox() { unInstallSingBox() {
local type=$1 local type=$1
@ -970,10 +984,10 @@ cleanUp() {
initVar "$1" initVar "$1"
checkSystem checkSystem
checkCPUVendor checkCPUVendor
readInstallType readInstallType
readInstallProtocolType readInstallProtocolType
readConfigHostPathUUID readConfigHostPathUUID
#readInstallAlpn
readCustomPort readCustomPort
readSingBoxConfig readSingBoxConfig
# ------------------------------------------------------------- # -------------------------------------------------------------
@ -1378,7 +1392,7 @@ EOF
initTLSNginxConfig() { initTLSNginxConfig() {
handleNginx stop handleNginx stop
echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化Nginx申请证书配置" echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化Nginx申请证书配置"
if [[ -n "${currentHost}" ]]; then if [[ -n "${currentHost}" && -z "${lastInstallationConfig}" ]]; then
echo echo
read -r -p "读取到上次安装记录,是否使用上次安装时的域名 [y/n]:" historyDomainStatus read -r -p "读取到上次安装记录,是否使用上次安装时的域名 [y/n]:" historyDomainStatus
if [[ "${historyDomainStatus}" == "y" ]]; then if [[ "${historyDomainStatus}" == "y" ]]; then
@ -1389,6 +1403,8 @@ initTLSNginxConfig() {
echoContent yellow "请输入要配置的域名 例: www.v2ray-agent.com --->" echoContent yellow "请输入要配置的域名 例: www.v2ray-agent.com --->"
read -r -p "域名:" domain read -r -p "域名:" domain
fi fi
elif [[ -n "${currentHost}" && -n "${lastInstallationConfig}" ]]; then
domain=${currentHost}
else else
echo echo
echoContent yellow "请输入要配置的域名 例: www.v2ray-agent.com --->" echoContent yellow "请输入要配置的域名 例: www.v2ray-agent.com --->"
@ -1808,10 +1824,14 @@ customPortFunction() {
local historyCustomPortStatus= local historyCustomPortStatus=
if [[ -n "${customPort}" || -n "${currentPort}" ]]; then if [[ -n "${customPort}" || -n "${currentPort}" ]]; then
echo echo
read -r -p "读取到上次安装时的端口,是否使用上次安装时的端口?[y/n]:" historyCustomPortStatus if [[ -z "${lastInstallationConfig}" ]]; then
if [[ "${historyCustomPortStatus}" == "y" ]]; then read -r -p "读取到上次安装时的端口,是否使用上次安装时的端口?[y/n]:" historyCustomPortStatus
if [[ "${historyCustomPortStatus}" == "y" ]]; then
port=${currentPort}
echoContent yellow "\n ---> 端口: ${port}"
fi
elif [[ -n "${lastInstallationConfig}" ]]; then
port=${currentPort} port=${currentPort}
echoContent yellow "\n ---> 端口: ${port}"
fi fi
fi fi
if [[ -z "${currentPort}" ]] || [[ "${historyCustomPortStatus}" == "n" ]]; then if [[ -z "${currentPort}" ]] || [[ "${historyCustomPortStatus}" == "n" ]]; then
@ -1884,11 +1904,13 @@ installTLS() {
else else
if [[ -d "$HOME/.acme.sh/${tlsDomain}_ecc" && -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.key" && -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.cer" ]] || [[ "${installedDNSAPIStatus}" == "true" ]]; then if [[ -d "$HOME/.acme.sh/${tlsDomain}_ecc" && -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.key" && -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.cer" ]] || [[ "${installedDNSAPIStatus}" == "true" ]]; then
echoContent yellow " ---> 如未过期或者自定义证书请选择[n]\n" if [[ -z "${lastInstallationConfig}" ]]; then
read -r -p "是否重新安装?[y/n]:" reInstallStatus echoContent yellow " ---> 如未过期或者自定义证书请选择[n]\n"
if [[ "${reInstallStatus}" == "y" ]]; then read -r -p "是否重新安装?[y/n]:" reInstallStatus
rm -rf /etc/v2ray-agent/tls/* if [[ "${reInstallStatus}" == "y" ]]; then
installTLS "$1" rm -rf /etc/v2ray-agent/tls/*
installTLS "$1"
fi
fi fi
fi fi
fi fi
@ -1957,10 +1979,12 @@ randomPathFunction() {
echoContent skyBlue "生成随机路径" echoContent skyBlue "生成随机路径"
fi fi
if [[ -n "${currentPath}" ]]; then if [[ -n "${currentPath}" && -z "${lastInstallationConfig}" ]]; then
echo echo
read -r -p "读取到上次安装记录是否使用上次安装时的path路径 [y/n]:" historyPathStatus read -r -p "读取到上次安装记录是否使用上次安装时的path路径 [y/n]:" historyPathStatus
echo echo
elif [[ -n "${currentPath}" && -n "${lastInstallationConfig}" ]]; then
historyPathStatus="y"
fi fi
if [[ "${historyPathStatus}" == "y" ]]; then if [[ "${historyPathStatus}" == "y" ]]; then
@ -2005,7 +2029,12 @@ nginxBlog() {
if [[ -d "${nginxStaticPath}" && -f "${nginxStaticPath}/check" ]]; then if [[ -d "${nginxStaticPath}" && -f "${nginxStaticPath}/check" ]]; then
echo echo
read -r -p "检测到安装伪装站点,是否需要重新安装[y/n]:" nginxBlogInstallStatus if [[ -z "${lastInstallationConfig}" ]]; then
read -r -p "检测到安装伪装站点,是否需要重新安装[y/n]:" nginxBlogInstallStatus
else
nginxBlogInstallStatus="n"
fi
if [[ "${nginxBlogInstallStatus}" == "y" ]]; then if [[ "${nginxBlogInstallStatus}" == "y" ]]; then
rm -rf "${nginxStaticPath}*" rm -rf "${nginxStaticPath}*"
# randomNum=$((RANDOM % 6 + 1)) # randomNum=$((RANDOM % 6 + 1))
@ -2288,10 +2317,12 @@ installSingBox() {
fi fi
else else
echoContent green " ---> sing-box版本:v$(/etc/v2ray-agent/sing-box/sing-box version | grep "sing-box version" | awk '{print $3}')" echoContent green " ---> sing-box版本:v$(/etc/v2ray-agent/sing-box/sing-box version | grep "sing-box version" | awk '{print $3}')"
read -r -p "是否更新、升级?[y/n]:" reInstallSingBoxStatus if [[ -z "${lastInstallationConfig}" ]]; then
if [[ "${reInstallSingBoxStatus}" == "y" ]]; then read -r -p "是否更新、升级?[y/n]:" reInstallSingBoxStatus
rm -f /etc/v2ray-agent/sing-box/sing-box if [[ "${reInstallSingBoxStatus}" == "y" ]]; then
installSingBox "$1" rm -f /etc/v2ray-agent/sing-box/sing-box
installSingBox "$1"
fi
fi fi
fi fi
@ -2318,7 +2349,6 @@ installXray() {
if [[ ! -f "/etc/v2ray-agent/xray/xray" ]]; then if [[ ! -f "/etc/v2ray-agent/xray/xray" ]]; then
version=$(curl -s "https://api.github.com/repos/XTLS/Xray-core/releases?per_page=5" | jq -r ".[]|select (.prerelease==${prereleaseStatus})|.tag_name" | head -1) version=$(curl -s "https://api.github.com/repos/XTLS/Xray-core/releases?per_page=5" | jq -r ".[]|select (.prerelease==${prereleaseStatus})|.tag_name" | head -1)
echoContent green " ---> Xray-core版本:${version}" echoContent green " ---> Xray-core版本:${version}"
if [[ "${release}" == "alpine" ]]; then if [[ "${release}" == "alpine" ]]; then
wget -c -q -P /etc/v2ray-agent/xray/ "https://github.com/XTLS/Xray-core/releases/download/${version}/${xrayCoreCPUVendor}.zip" wget -c -q -P /etc/v2ray-agent/xray/ "https://github.com/XTLS/Xray-core/releases/download/${version}/${xrayCoreCPUVendor}.zip"
@ -2351,11 +2381,13 @@ installXray() {
chmod 655 /etc/v2ray-agent/xray/xray chmod 655 /etc/v2ray-agent/xray/xray
fi fi
else else
echoContent green " ---> Xray-core版本:$(/etc/v2ray-agent/xray/xray --version | awk '{print $2}' | head -1)" if [[ -z "${lastInstallationConfig}" ]]; then
read -r -p "是否更新、升级?[y/n]:" reInstallXrayStatus echoContent green " ---> Xray-core版本:$(/etc/v2ray-agent/xray/xray --version | awk '{print $2}' | head -1)"
if [[ "${reInstallXrayStatus}" == "y" ]]; then read -r -p "是否更新、升级?[y/n]:" reInstallXrayStatus
rm -f /etc/v2ray-agent/xray/xray if [[ "${reInstallXrayStatus}" == "y" ]]; then
installXray "$1" "$2" rm -f /etc/v2ray-agent/xray/xray
installXray "$1" "$2"
fi
fi fi
fi fi
} }
@ -3975,13 +4007,15 @@ initXrayFrontingConfig() {
# 初始化sing-box端口 # 初始化sing-box端口
initSingBoxPort() { initSingBoxPort() {
local port=$1 local port=$1
if [[ -n "${port}" ]]; then if [[ -n "${port}" && -z "${lastInstallationConfig}" ]]; then
read -r -p "读取到上次使用的端口,是否使用 [y/n]:" historyPort read -r -p "读取到上次使用的端口,是否使用 [y/n]:" historyPort
if [[ "${historyPort}" != "y" ]]; then if [[ "${historyPort}" != "y" ]]; then
port= port=
else else
echo "${port}" echo "${port}"
fi fi
elif [[ -n "${port}" && -n "${lastInstallationConfig}" ]]; then
echo "${port}"
fi fi
if [[ -z "${port}" ]]; then if [[ -z "${port}" ]]; then
read -r -p '请输入自定义端口[需合法],端口不可重复,[回车]随机端口:' port read -r -p '请输入自定义端口[需合法],端口不可重复,[回车]随机端口:' port
@ -4005,12 +4039,14 @@ initXrayConfig() {
echo echo
local uuid= local uuid=
local addClientsStatus= local addClientsStatus=
if [[ -n "${currentUUID}" ]]; then if [[ -n "${currentUUID}" && -z "${lastInstallationConfig}" ]]; then
read -r -p "读取到上次用户配置,是否使用上次安装的配置 [y/n]:" historyUUIDStatus read -r -p "读取到上次用户配置,是否使用上次安装的配置 [y/n]:" historyUUIDStatus
if [[ "${historyUUIDStatus}" == "y" ]]; then if [[ "${historyUUIDStatus}" == "y" ]]; then
addClientsStatus=true addClientsStatus=true
echoContent green "\n ---> 使用成功" echoContent green "\n ---> 使用成功"
fi fi
elif [[ -n "${currentUUID}" && -n "${lastInstallationConfig}" ]]; then
addClientsStatus=true
fi fi
if [[ -z "${addClientsStatus}" ]]; then if [[ -z "${addClientsStatus}" ]]; then
@ -4351,6 +4387,7 @@ EOF
# VLESS_TCP/reality # VLESS_TCP/reality
if echo "${selectCustomInstallType}" | grep -q ",7," || [[ "$1" == "all" ]]; then if echo "${selectCustomInstallType}" | grep -q ",7," || [[ "$1" == "all" ]]; then
echoContent skyBlue "\n===================== 配置VLESS+Reality =====================\n" echoContent skyBlue "\n===================== 配置VLESS+Reality =====================\n"
initXrayRealityPort initXrayRealityPort
initRealityClientServersName initRealityClientServersName
initRealityKey initRealityKey
@ -4466,12 +4503,14 @@ initSingBoxConfig() {
elif [[ -n "${currentHost}" ]]; then elif [[ -n "${currentHost}" ]]; then
sslDomain="${currentHost}" sslDomain="${currentHost}"
fi fi
if [[ -n "${currentUUID}" ]]; then if [[ -n "${currentUUID}" && -z "${lastInstallationConfig}" ]]; then
read -r -p "读取到上次用户配置,是否使用上次安装的配置 [y/n]:" historyUUIDStatus read -r -p "读取到上次用户配置,是否使用上次安装的配置 [y/n]:" historyUUIDStatus
if [[ "${historyUUIDStatus}" == "y" ]]; then if [[ "${historyUUIDStatus}" == "y" ]]; then
addClientsStatus=true addClientsStatus=true
echoContent green "\n ---> 使用成功" echoContent green "\n ---> 使用成功"
fi fi
elif [[ -n "${currentUUID}" && -n "${lastInstallationConfig}" ]]; then
addClientsStatus=true
fi fi
if [[ -z "${addClientsStatus}" ]]; then if [[ -z "${addClientsStatus}" ]]; then
@ -8028,6 +8067,7 @@ customSingBoxInstall() {
fi fi
if [[ "${selectCustomInstallType//,/}" =~ ^[0-9]+$ ]]; then if [[ "${selectCustomInstallType//,/}" =~ ^[0-9]+$ ]]; then
readLastInstallationConfig
totalProgress=9 totalProgress=9
installTools 1 installTools 1
# 申请tls # 申请tls
@ -8098,6 +8138,7 @@ customXrayInstall() {
selectCustomInstallType=",${selectCustomInstallType}," selectCustomInstallType=",${selectCustomInstallType},"
fi fi
if [[ "${selectCustomInstallType//,/}" =~ ^[0-7]+$ ]]; then if [[ "${selectCustomInstallType//,/}" =~ ^[0-7]+$ ]]; then
readLastInstallationConfig
unInstallSubscribe unInstallSubscribe
checkBTPanel checkBTPanel
check1Panel check1Panel
@ -8156,7 +8197,7 @@ customXrayInstall() {
fi fi
} }
# 选择核心安装---v2ray-core、xray-core # 选择核心安装sing-box、xray-core
selectCoreInstall() { selectCoreInstall() {
echoContent skyBlue "\n功能 1/${totalProgress} : 选择核心安装" echoContent skyBlue "\n功能 1/${totalProgress} : 选择核心安装"
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
@ -8188,6 +8229,7 @@ selectCoreInstall() {
# xray-core 安装 # xray-core 安装
xrayCoreInstall() { xrayCoreInstall() {
readLastInstallationConfig
unInstallSubscribe unInstallSubscribe
checkBTPanel checkBTPanel
check1Panel check1Panel
@ -8233,17 +8275,12 @@ xrayCoreInstall() {
# sing-box 全部安装 # sing-box 全部安装
singBoxInstall() { singBoxInstall() {
readLastInstallationConfig
checkBTPanel checkBTPanel
check1Panel check1Panel
selectCustomInstallType= selectCustomInstallType=
totalProgress=8 totalProgress=8
installTools 2 installTools 2
# if [[ -n "${btDomain}" ]]; then
# echoContent skyBlue "\n进度 3/${totalProgress} : 检测到宝塔面板跳过申请TLS步骤"
# handleXray stop
# customPortFunction
# else
# 申请tls
if [[ -n "${btDomain}" ]]; then if [[ -n "${btDomain}" ]]; then
echoContent skyBlue "\n进度 3/${totalProgress} : 检测到宝塔面板/1Panel跳过申请TLS步骤" echoContent skyBlue "\n进度 3/${totalProgress} : 检测到宝塔面板/1Panel跳过申请TLS步骤"
@ -8261,6 +8298,7 @@ singBoxInstall() {
installSingBox 5 installSingBox 5
installSingBoxService 6 installSingBoxService 6
initSingBoxConfig all 7 initSingBoxConfig all 7
cleanUp xrayDel cleanUp xrayDel
installCronTLS 8 installCronTLS 8
@ -9183,12 +9221,15 @@ switchAlpn() {
# 初始化realityKey # 初始化realityKey
initRealityKey() { initRealityKey() {
echoContent skyBlue "\n生成Reality key\n" echoContent skyBlue "\n生成Reality key\n"
if [[ -n "${currentRealityPublicKey}" ]]; then if [[ -n "${currentRealityPublicKey}" && -z "${lastInstallationConfig}" ]]; then
read -r -p "读取到上次安装记录是否使用上次安装时的PublicKey/PrivateKey [y/n]:" historyKeyStatus read -r -p "读取到上次安装记录是否使用上次安装时的PublicKey/PrivateKey [y/n]:" historyKeyStatus
if [[ "${historyKeyStatus}" == "y" ]]; then if [[ "${historyKeyStatus}" == "y" ]]; then
realityPrivateKey=${currentRealityPrivateKey} realityPrivateKey=${currentRealityPrivateKey}
realityPublicKey=${currentRealityPublicKey} realityPublicKey=${currentRealityPublicKey}
fi fi
elif [[ -n "${currentRealityPublicKey}" && -n "${lastInstallationConfig}" ]]; then
realityPrivateKey=${currentRealityPrivateKey}
realityPublicKey=${currentRealityPublicKey}
fi fi
if [[ -z "${realityPrivateKey}" ]]; then if [[ -z "${realityPrivateKey}" ]]; then
if [[ "${selectCoreType}" == "2" || "${coreInstallType}" == "2" ]]; then if [[ "${selectCoreType}" == "2" || "${coreInstallType}" == "2" ]]; then
@ -9247,47 +9288,58 @@ initRealityDest() {
} }
# 初始化客户端可用的ServersName # 初始化客户端可用的ServersName
initRealityClientServersName() { initRealityClientServersName() {
realityServerName=
if [[ -n "${domain}" ]]; then if [[ -n "${realityServerName}" && -z "${lastInstallationConfig}" ]]; then
echo read -r -p "读取到上次安装设置的Reality域名是否使用[y/n]:" realityServerNameStatus
read -r -p "是否使用 ${domain} 此域名作为Reality目标域名 [y/n]:" realityServerNameCurrentDomainStatus if [[ "${realityServerNameStatus}" != "y" ]]; then
if [[ "${realityServerNameCurrentDomainStatus}" == "y" ]]; then realityServerName=
realityServerName="${domain}" fi
if [[ "${selectCoreType}" == "1" ]]; then elif [[ -z "${lastInstallationConfig}" ]]; then
# if [[ -n "${port}" ]]; then realityServerName=
# realityDomainPort="${port}" fi
if [[ -z "${subscribePort}" ]]; then if [[ -n "${realityServerName}" ]] && [[ "${realityServerName}" != "${domain}" ]]; then
realityDomainPort=443
fi
if [[ -z "${realityServerName}" ]]; then
if [[ -n "${domain}" ]]; then
echo
read -r -p "是否使用 ${domain} 此域名作为Reality目标域名 [y/n]:" realityServerNameCurrentDomainStatus
if [[ "${realityServerNameCurrentDomainStatus}" == "y" ]]; then
realityServerName="${domain}"
if [[ "${selectCoreType}" == "1" ]]; then
if [[ -z "${subscribePort}" ]]; then
echo
installSubscribe
readNginxSubscribe
realityDomainPort="${subscribePort}"
fi
fi
if [[ "${selectCoreType}" == "2" && -z "${subscribePort}" ]]; then
echo echo
installSubscribe installSubscribe
readNginxSubscribe readNginxSubscribe
realityDomainPort="${subscribePort}" realityDomainPort="${subscribePort}"
fi fi
fi fi
if [[ "${selectCoreType}" == "2" && -z "${subscribePort}" ]]; then
echo
installSubscribe
readNginxSubscribe
realityDomainPort="${subscribePort}"
fi
fi fi
fi
if [[ -z "${realityServerName}" ]]; then
local realityDestDomainList="gateway.icloud.com,itunes.apple.com,swdist.apple.com,swcdn.apple.com,updates.cdn-apple.com,mensura.cdn-apple.com,osxapps.itunes.apple.com,aod.itunes.apple.com,download-installer.cdn.mozilla.net,addons.mozilla.org,s0.awsstatic.com,d1.awsstatic.com,images-na.ssl-images-amazon.com,m.media-amazon.com,player.live-video.net,one-piece.com,lol.secure.dyn.riotcdn.net,www.lovelive-anime.jp,www.swift.com,academy.nvidia.com,www.cisco.com,www.asus.com,www.samsung.com,www.amd.com,cdn-dynmedia-1.microsoft.com,software.download.prss.microsoft.com,dl.google.com,www.google-analytics.com"
realityDomainPort=443
echoContent skyBlue "\n================ 配置客户端可用的serverNames ===============\n"
echoContent yellow "#注意事项"
echoContent green "Reality目标可用域名列表https://www.v2ray-agent.com/archives/1689439383686#heading-3\n"
echoContent yellow "录入示例:addons.mozilla.org:443\n"
read -r -p "请输入目标域名,[回车]随机域名默认端口443:" realityServerName
if [[ -z "${realityServerName}" ]]; then if [[ -z "${realityServerName}" ]]; then
# randomNum=$((RANDOM % 27 + 1)) local realityDestDomainList="gateway.icloud.com,itunes.apple.com,swdist.apple.com,swcdn.apple.com,updates.cdn-apple.com,mensura.cdn-apple.com,osxapps.itunes.apple.com,aod.itunes.apple.com,download-installer.cdn.mozilla.net,addons.mozilla.org,s0.awsstatic.com,d1.awsstatic.com,images-na.ssl-images-amazon.com,m.media-amazon.com,player.live-video.net,one-piece.com,lol.secure.dyn.riotcdn.net,www.lovelive-anime.jp,www.swift.com,academy.nvidia.com,www.cisco.com,www.asus.com,www.samsung.com,www.amd.com,cdn-dynmedia-1.microsoft.com,software.download.prss.microsoft.com,dl.google.com,www.google-analytics.com"
randomNum=$(randomNum 1 27) realityDomainPort=443
realityServerName=$(echo "${realityDestDomainList}" | awk -F ',' -v randomNum="$randomNum" '{print $randomNum}') echoContent skyBlue "\n================ 配置客户端可用的serverNames ===============\n"
fi echoContent yellow "#注意事项"
if echo "${realityServerName}" | grep -q ":"; then echoContent green "Reality目标可用域名列表https://www.v2ray-agent.com/archives/1689439383686#heading-3\n"
realityDomainPort=$(echo "${realityServerName}" | awk -F "[:]" '{print $2}') echoContent yellow "录入示例:addons.mozilla.org:443\n"
realityServerName=$(echo "${realityServerName}" | awk -F "[:]" '{print $1}') read -r -p "请输入目标域名,[回车]随机域名默认端口443:" realityServerName
if [[ -z "${realityServerName}" ]]; then
randomNum=$(randomNum 1 27)
realityServerName=$(echo "${realityDestDomainList}" | awk -F ',' -v randomNum="$randomNum" '{print $randomNum}')
fi
if echo "${realityServerName}" | grep -q ":"; then
realityDomainPort=$(echo "${realityServerName}" | awk -F "[:]" '{print $2}')
realityServerName=$(echo "${realityServerName}" | awk -F "[:]" '{print $1}')
fi
fi fi
fi fi
@ -9295,11 +9347,13 @@ initRealityClientServersName() {
} }
# 初始化reality端口 # 初始化reality端口
initXrayRealityPort() { initXrayRealityPort() {
if [[ -n "${xrayVLESSRealityPort}" ]]; then if [[ -n "${xrayVLESSRealityPort}" && -z "${lastInstallationConfig}" ]]; then
read -r -p "读取到上次安装记录,是否使用上次安装时的端口 [y/n]:" historyRealityPortStatus read -r -p "读取到上次安装记录,是否使用上次安装时的端口 [y/n]:" historyRealityPortStatus
if [[ "${historyRealityPortStatus}" == "y" ]]; then if [[ "${historyRealityPortStatus}" == "y" ]]; then
realityPort=${xrayVLESSRealityPort} realityPort=${xrayVLESSRealityPort}
fi fi
elif [[ -n "${xrayVLESSRealityPort}" && -n "${lastInstallationConfig}" ]]; then
realityPort=${xrayVLESSRealityPort}
fi fi
if [[ -z "${realityPort}" ]]; then if [[ -z "${realityPort}" ]]; then
@ -9332,11 +9386,13 @@ initXrayRealityPort() {
} }
# 初始化SplitHTTP端口 # 初始化SplitHTTP端口
initXraySplitPort() { initXraySplitPort() {
if [[ -n "${xrayVLESSSplitHTTPort}" ]]; then if [[ -n "${xrayVLESSSplitHTTPort}" && -z "${lastInstallationConfig}" ]]; then
read -r -p "读取到上次安装记录,是否使用上次安装时的端口 [y/n]:" historySplitHTTPortStatus read -r -p "读取到上次安装记录,是否使用上次安装时的端口 [y/n]:" historySplitHTTPortStatus
if [[ "${historySplitHTTPortStatus}" == "y" ]]; then if [[ "${historySplitHTTPortStatus}" == "y" ]]; then
splitHTTPort=${xrayVLESSSplitHTTPort} splitHTTPort=${xrayVLESSSplitHTTPort}
fi fi
elif [[ -n "${xrayVLESSSplitHTTPort}" && -n "${lastInstallationConfig}" ]]; then
splitHTTPort=${xrayVLESSSplitHTTPort}
fi fi
if [[ -z "${splitHTTPort}" ]]; then if [[ -z "${splitHTTPort}" ]]; then
@ -9629,7 +9685,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v3.3.18" echoContent green "当前版本v3.3.19"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus