mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 增加快捷重新安装(读取上次配置)
parent
f1e2708606
commit
795eb7a8f8
98
install.sh
98
install.sh
|
@ -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,11 +1824,15 @@ customPortFunction() {
|
||||||
local historyCustomPortStatus=
|
local historyCustomPortStatus=
|
||||||
if [[ -n "${customPort}" || -n "${currentPort}" ]]; then
|
if [[ -n "${customPort}" || -n "${currentPort}" ]]; then
|
||||||
echo
|
echo
|
||||||
|
if [[ -z "${lastInstallationConfig}" ]]; then
|
||||||
read -r -p "读取到上次安装时的端口,是否使用上次安装时的端口?[y/n]:" historyCustomPortStatus
|
read -r -p "读取到上次安装时的端口,是否使用上次安装时的端口?[y/n]:" historyCustomPortStatus
|
||||||
if [[ "${historyCustomPortStatus}" == "y" ]]; then
|
if [[ "${historyCustomPortStatus}" == "y" ]]; then
|
||||||
port=${currentPort}
|
port=${currentPort}
|
||||||
echoContent yellow "\n ---> 端口: ${port}"
|
echoContent yellow "\n ---> 端口: ${port}"
|
||||||
fi
|
fi
|
||||||
|
elif [[ -n "${lastInstallationConfig}" ]]; then
|
||||||
|
port=${currentPort}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -z "${currentPort}" ]] || [[ "${historyCustomPortStatus}" == "n" ]]; then
|
if [[ -z "${currentPort}" ]] || [[ "${historyCustomPortStatus}" == "n" ]]; then
|
||||||
echo
|
echo
|
||||||
|
@ -1884,6 +1904,7 @@ 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
|
||||||
|
if [[ -z "${lastInstallationConfig}" ]]; then
|
||||||
echoContent yellow " ---> 如未过期或者自定义证书请选择[n]\n"
|
echoContent yellow " ---> 如未过期或者自定义证书请选择[n]\n"
|
||||||
read -r -p "是否重新安装?[y/n]:" reInstallStatus
|
read -r -p "是否重新安装?[y/n]:" reInstallStatus
|
||||||
if [[ "${reInstallStatus}" == "y" ]]; then
|
if [[ "${reInstallStatus}" == "y" ]]; then
|
||||||
|
@ -1892,6 +1913,7 @@ installTLS() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
elif [[ -d "$HOME/.acme.sh" ]] && [[ ! -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.cer" || ! -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.key" ]]; then
|
elif [[ -d "$HOME/.acme.sh" ]] && [[ ! -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.cer" || ! -f "$HOME/.acme.sh/${tlsDomain}_ecc/${tlsDomain}.key" ]]; then
|
||||||
switchDNSAPI
|
switchDNSAPI
|
||||||
|
@ -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
|
||||||
|
if [[ -z "${lastInstallationConfig}" ]]; then
|
||||||
read -r -p "检测到安装伪装站点,是否需要重新安装[y/n]:" nginxBlogInstallStatus
|
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,12 +2317,14 @@ 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}')"
|
||||||
|
if [[ -z "${lastInstallationConfig}" ]]; then
|
||||||
read -r -p "是否更新、升级?[y/n]:" reInstallSingBoxStatus
|
read -r -p "是否更新、升级?[y/n]:" reInstallSingBoxStatus
|
||||||
if [[ "${reInstallSingBoxStatus}" == "y" ]]; then
|
if [[ "${reInstallSingBoxStatus}" == "y" ]]; then
|
||||||
rm -f /etc/v2ray-agent/sing-box/sing-box
|
rm -f /etc/v2ray-agent/sing-box/sing-box
|
||||||
installSingBox "$1"
|
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,6 +2381,7 @@ installXray() {
|
||||||
chmod 655 /etc/v2ray-agent/xray/xray
|
chmod 655 /etc/v2ray-agent/xray/xray
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
if [[ -z "${lastInstallationConfig}" ]]; then
|
||||||
echoContent green " ---> Xray-core版本:$(/etc/v2ray-agent/xray/xray --version | awk '{print $2}' | head -1)"
|
echoContent green " ---> Xray-core版本:$(/etc/v2ray-agent/xray/xray --version | awk '{print $2}' | head -1)"
|
||||||
read -r -p "是否更新、升级?[y/n]:" reInstallXrayStatus
|
read -r -p "是否更新、升级?[y/n]:" reInstallXrayStatus
|
||||||
if [[ "${reInstallXrayStatus}" == "y" ]]; then
|
if [[ "${reInstallXrayStatus}" == "y" ]]; then
|
||||||
|
@ -2358,6 +2389,7 @@ installXray() {
|
||||||
installXray "$1" "$2"
|
installXray "$1" "$2"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# v2ray版本管理
|
# v2ray版本管理
|
||||||
|
@ -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,15 +9288,26 @@ initRealityDest() {
|
||||||
}
|
}
|
||||||
# 初始化客户端可用的ServersName
|
# 初始化客户端可用的ServersName
|
||||||
initRealityClientServersName() {
|
initRealityClientServersName() {
|
||||||
|
|
||||||
|
if [[ -n "${realityServerName}" && -z "${lastInstallationConfig}" ]]; then
|
||||||
|
read -r -p "读取到上次安装设置的Reality域名,是否使用?[y/n]:" realityServerNameStatus
|
||||||
|
if [[ "${realityServerNameStatus}" != "y" ]]; then
|
||||||
realityServerName=
|
realityServerName=
|
||||||
|
fi
|
||||||
|
elif [[ -z "${lastInstallationConfig}" ]]; then
|
||||||
|
realityServerName=
|
||||||
|
fi
|
||||||
|
if [[ -n "${realityServerName}" ]] && [[ "${realityServerName}" != "${domain}" ]]; then
|
||||||
|
realityDomainPort=443
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${realityServerName}" ]]; then
|
||||||
if [[ -n "${domain}" ]]; then
|
if [[ -n "${domain}" ]]; then
|
||||||
echo
|
echo
|
||||||
read -r -p "是否使用 ${domain} 此域名作为Reality目标域名 ?[y/n]:" realityServerNameCurrentDomainStatus
|
read -r -p "是否使用 ${domain} 此域名作为Reality目标域名 ?[y/n]:" realityServerNameCurrentDomainStatus
|
||||||
if [[ "${realityServerNameCurrentDomainStatus}" == "y" ]]; then
|
if [[ "${realityServerNameCurrentDomainStatus}" == "y" ]]; then
|
||||||
realityServerName="${domain}"
|
realityServerName="${domain}"
|
||||||
if [[ "${selectCoreType}" == "1" ]]; then
|
if [[ "${selectCoreType}" == "1" ]]; then
|
||||||
# if [[ -n "${port}" ]]; then
|
|
||||||
# realityDomainPort="${port}"
|
|
||||||
if [[ -z "${subscribePort}" ]]; then
|
if [[ -z "${subscribePort}" ]]; then
|
||||||
echo
|
echo
|
||||||
installSubscribe
|
installSubscribe
|
||||||
|
@ -9281,7 +9333,6 @@ initRealityClientServersName() {
|
||||||
echoContent yellow "录入示例:addons.mozilla.org:443\n"
|
echoContent yellow "录入示例:addons.mozilla.org:443\n"
|
||||||
read -r -p "请输入目标域名,[回车]随机域名,默认端口443:" realityServerName
|
read -r -p "请输入目标域名,[回车]随机域名,默认端口443:" realityServerName
|
||||||
if [[ -z "${realityServerName}" ]]; then
|
if [[ -z "${realityServerName}" ]]; then
|
||||||
# randomNum=$((RANDOM % 27 + 1))
|
|
||||||
randomNum=$(randomNum 1 27)
|
randomNum=$(randomNum 1 27)
|
||||||
realityServerName=$(echo "${realityDestDomainList}" | awk -F ',' -v randomNum="$randomNum" '{print $randomNum}')
|
realityServerName=$(echo "${realityDestDomainList}" | awk -F ',' -v randomNum="$randomNum" '{print $randomNum}')
|
||||||
fi
|
fi
|
||||||
|
@ -9290,16 +9341,19 @@ initRealityClientServersName() {
|
||||||
realityServerName=$(echo "${realityServerName}" | awk -F "[:]" '{print $1}')
|
realityServerName=$(echo "${realityServerName}" | awk -F "[:]" '{print $1}')
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echoContent yellow "\n ---> 客户端可用域名: ${realityServerName}:${realityDomainPort}\n"
|
echoContent yellow "\n ---> 客户端可用域名: ${realityServerName}:${realityDomainPort}\n"
|
||||||
}
|
}
|
||||||
# 初始化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 "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