mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): update
parent
a52657ddd0
commit
50d49f87ff
223
install.sh
223
install.sh
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# 检测区
|
||||||
|
# -------------------------------------------------------------
|
||||||
# 检查系统
|
# 检查系统
|
||||||
checkSystem(){
|
checkSystem(){
|
||||||
if [[ ! -z `find /etc -name "redhat-release"` ]] || [[ ! -z `cat /proc/version | grep -i "centos" | grep -v grep ` ]]
|
if [[ ! -z `find /etc -name "redhat-release"` ]] || [[ ! -z `cat /proc/version | grep -i "centos" | grep -v grep ` ]]
|
||||||
|
@ -36,22 +38,22 @@ initVar(){
|
||||||
removeType='yum -y remove'
|
removeType='yum -y remove'
|
||||||
upgrade="yum -y update"
|
upgrade="yum -y update"
|
||||||
echoType='echo -e'
|
echoType='echo -e'
|
||||||
branch=master
|
|
||||||
|
|
||||||
coreType=
|
# 域名
|
||||||
domain=
|
domain=
|
||||||
|
|
||||||
|
# CDN节点的address
|
||||||
add=
|
add=
|
||||||
globalType=
|
|
||||||
customPath=
|
# 安装总进度
|
||||||
centosVersion=0
|
|
||||||
totalProgress=1
|
totalProgress=1
|
||||||
iplc=$1
|
|
||||||
|
# UUID
|
||||||
uuid=
|
uuid=
|
||||||
uuidDirect=
|
uuidDirect=
|
||||||
newUUID=
|
newUUID=
|
||||||
newDirectUUID=
|
newDirectUUID=
|
||||||
|
|
||||||
|
|
||||||
# 1.xray-core安装
|
# 1.xray-core安装
|
||||||
# 2.v2ray-core 安装
|
# 2.v2ray-core 安装
|
||||||
# 3.v2ray-core[xtls] 安装
|
# 3.v2ray-core[xtls] 安装
|
||||||
|
@ -59,7 +61,7 @@ initVar(){
|
||||||
|
|
||||||
# 1.全部安装
|
# 1.全部安装
|
||||||
# 2.个性化安装
|
# 2.个性化安装
|
||||||
installType=
|
v2rayAgentInstallType=
|
||||||
|
|
||||||
# 当前的个性化安装方式
|
# 当前的个性化安装方式
|
||||||
currentCustomInstallType=
|
currentCustomInstallType=
|
||||||
|
@ -84,6 +86,12 @@ initVar(){
|
||||||
|
|
||||||
# 默认core版本
|
# 默认core版本
|
||||||
v2rayCoreVersion=
|
v2rayCoreVersion=
|
||||||
|
|
||||||
|
# 随机路径
|
||||||
|
customPath=
|
||||||
|
|
||||||
|
# centos version
|
||||||
|
centosVersion=
|
||||||
}
|
}
|
||||||
|
|
||||||
# 检测安装方式
|
# 检测安装方式
|
||||||
|
@ -95,21 +103,20 @@ initInstallType(){
|
||||||
if [[ -f "/etc/v2ray-agent/v2ray/v2ray" && -f "/etc/v2ray-agent/v2ray/v2ctl" ]]
|
if [[ -f "/etc/v2ray-agent/v2ray/v2ray" && -f "/etc/v2ray-agent/v2ray/v2ctl" ]]
|
||||||
then
|
then
|
||||||
coreInstallStatus=true
|
coreInstallStatus=true
|
||||||
if [[ -f "/etc/v2ray-agent/v2ray/v2ray_full.json" ]]
|
if [[ -f "/etc/v2ray-agent/v2ray/config_full.json" ]]
|
||||||
then
|
then
|
||||||
|
v2rayAgentInstallType=1
|
||||||
installType=1
|
if [[ ! -z `cat /etc/v2ray-agent/v2ray/config_full.json|grep xtls` ]]
|
||||||
if [[ ! -z `cat /etc/v2ray-agent/v2ray/v2ray_full.json|grep xtls` ]]
|
|
||||||
then
|
then
|
||||||
v2rayCoreInstallType=3
|
v2rayCoreInstallType=3
|
||||||
elif [[ -z `cat /etc/v2ray-agent/v2ray/v2ray_full.json|grep xtls` ]]
|
elif [[ -z `cat /etc/v2ray-agent/v2ray/config_full.json|grep xtls` ]]
|
||||||
then
|
then
|
||||||
v2rayCoreInstallType=2
|
v2rayCoreInstallType=2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ -d "/etc/v2ray-agent/v2ray/conf" && -f "/etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json" ]]
|
elif [[ -d "/etc/v2ray-agent/v2ray/conf" && -f "/etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json" ]]
|
||||||
then
|
then
|
||||||
installType=2
|
v2rayAgentInstallType=2
|
||||||
if [[ ! -z `cat /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json|grep xtls` ]]
|
if [[ ! -z `cat /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json|grep xtls` ]]
|
||||||
then
|
then
|
||||||
v2rayCoreInstallType=3
|
v2rayCoreInstallType=3
|
||||||
|
@ -127,7 +134,7 @@ initInstallType(){
|
||||||
|
|
||||||
# 检测个性化安装的方式
|
# 检测个性化安装的方式
|
||||||
initCustomInstallType(){
|
initCustomInstallType(){
|
||||||
if [[ "${installType}" = "2" ]]
|
if [[ "${v2rayAgentInstallType}" = "2" ]]
|
||||||
then
|
then
|
||||||
# currentCustomInstallType
|
# currentCustomInstallType
|
||||||
while read row
|
while read row
|
||||||
|
@ -155,18 +162,20 @@ initCustomInstallType(){
|
||||||
# 检查文件目录以及path路径
|
# 检查文件目录以及path路径
|
||||||
initConfigHostPath(){
|
initConfigHostPath(){
|
||||||
# config path
|
# config path
|
||||||
if [[ "${installType}" = "1" ]]
|
if [[ "${v2rayAgentInstallType}" = "1" ]]
|
||||||
then
|
then
|
||||||
v2rayConfigFilePath=/etc/v2ray-agent/v2ray/v2ray_full.json
|
v2rayConfigFilePath=/etc/v2ray-agent/v2ray/config_full.json
|
||||||
elif [[ "${installType}" = "2" ]]
|
|
||||||
|
elif [[ "${v2rayAgentInstallType}" = "2" ]]
|
||||||
then
|
then
|
||||||
v2rayConfigFilePath=/etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
v2rayConfigFilePath=/etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# path
|
# path
|
||||||
if [[ ! -z "${v2rayConfigFilePath}" ]]
|
if [[ ! -z "${v2rayConfigFilePath}" ]]
|
||||||
then
|
then
|
||||||
local path=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.fallbacks|jq -c '.[].path'|awk -F "[\"][/]" '{print $2}'|awk -F "[\"]" '{print $1}'|tail -n +2|head -n 1`
|
local path=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.fallbacks|jq -c '.[].path'|awk -F "[\"][/]" '{print $2}'|awk -F "[\"]" '{print $1}'|tail -n +2|head -n 1`
|
||||||
if [[ ! -z "${currentPath}" ]]
|
if [[ ! -z "${path}" ]]
|
||||||
then
|
then
|
||||||
currentPath=${path:0:4}
|
currentPath=${path:0:4}
|
||||||
fi
|
fi
|
||||||
|
@ -189,8 +198,26 @@ checkCoreStatus(){
|
||||||
if [[ -d "/etc/v2ray-agent" && -d "/etc/v2ray-agent/v2ray" ]] && [[ -f "/etc/v2ray-agent/v2ray/v2ray" && -f "/etc/v2ray-agent/v2ray/v2ctl" ]]
|
if [[ -d "/etc/v2ray-agent" && -d "/etc/v2ray-agent/v2ray" ]] && [[ -f "/etc/v2ray-agent/v2ray/v2ray" && -f "/etc/v2ray-agent/v2ray/v2ctl" ]]
|
||||||
then
|
then
|
||||||
coreInstallStatus=true
|
coreInstallStatus=true
|
||||||
|
else
|
||||||
|
coreInstallStatus=
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
initVar
|
||||||
|
echo initVar
|
||||||
|
checkSystem
|
||||||
|
echo checkSystem
|
||||||
|
initInstallType
|
||||||
|
echo initInstallType
|
||||||
|
checkCoreStatus
|
||||||
|
echo checkCoreStatus
|
||||||
|
initCustomInstallType
|
||||||
|
echo initCustomInstallType
|
||||||
|
initConfigHostPath
|
||||||
|
echo initConfigHostPath
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
|
||||||
echoContent(){
|
echoContent(){
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -223,6 +250,39 @@ echoContent(){
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echoContent red v2rayCoreInstallType:${v2rayCoreInstallType}
|
||||||
|
|
||||||
|
echoContent red v2rayAgentInstallType:${v2rayAgentInstallType}
|
||||||
|
|
||||||
|
# 当前的个性化安装方式
|
||||||
|
echoContent red currentCustomInstallType:${currentCustomInstallType}
|
||||||
|
|
||||||
|
# 选择的个性化安装方式
|
||||||
|
echoContent red selectCustomInstallType:${selectCustomInstallType}
|
||||||
|
|
||||||
|
# 配置文件的路径
|
||||||
|
echoContent red v2rayConfigFilePath:${v2rayConfigFilePath}
|
||||||
|
|
||||||
|
# 配置文件的path
|
||||||
|
echoContent red currentPath:${currentPath}
|
||||||
|
|
||||||
|
# 配置文件的host
|
||||||
|
echoContent red currentHost:${currentHost}
|
||||||
|
|
||||||
|
# 安装时选择的core类型
|
||||||
|
echoContent red selectCoreType:${selectCoreType}
|
||||||
|
|
||||||
|
|
||||||
|
echoContent red ${coreInstallStatus}
|
||||||
|
|
||||||
|
|
||||||
|
echoContent red ${v2rayCoreVersion}
|
||||||
|
|
||||||
|
|
||||||
|
echoContent red ${customPath}
|
||||||
|
|
||||||
|
|
||||||
|
echoContent red ${centosVersion}
|
||||||
# 初始化安装目录
|
# 初始化安装目录
|
||||||
mkdirTools(){
|
mkdirTools(){
|
||||||
mkdir -p /etc/v2ray-agent/tls
|
mkdir -p /etc/v2ray-agent/tls
|
||||||
|
@ -451,7 +511,7 @@ checkIP(){
|
||||||
# 安装TLS
|
# 安装TLS
|
||||||
installTLS(){
|
installTLS(){
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 申请TLS证书"
|
echoContent skyBlue "\n进度 $1/${totalProgress} : 申请TLS证书"
|
||||||
if [[ ! -z `ls /etc/v2ray-agent/tls|grep ${domain}.crt` ]] && [[ ! -z `ls /etc/v2ray-agent/tls|grep ${domain}.key` ]]
|
if [[ -z `ls /etc/v2ray-agent/tls|grep ${domain}.crt` ]] && [[ -z `ls /etc/v2ray-agent/tls|grep ${domain}.key` ]]
|
||||||
then
|
then
|
||||||
echoContent green " ---> 安装TLS证书"
|
echoContent green " ---> 安装TLS证书"
|
||||||
|
|
||||||
|
@ -507,8 +567,6 @@ randomPathFunction(){
|
||||||
customPath=
|
customPath=
|
||||||
if [[ ! -z "${v2rayConfigFilePath}" ]]
|
if [[ ! -z "${v2rayConfigFilePath}" ]]
|
||||||
then
|
then
|
||||||
|
|
||||||
v2rayConfigFilePath=/etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
|
||||||
path=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.fallbacks|jq -c '.[].path'|awk -F "[\"][/]" '{print $2}'|awk -F "[\"]" '{print $1}'|tail -n +2|head -n 1`
|
path=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.fallbacks|jq -c '.[].path'|awk -F "[\"][/]" '{print $2}'|awk -F "[\"]" '{print $1}'|tail -n +2|head -n 1`
|
||||||
customPath=${path:0:4}
|
customPath=${path:0:4}
|
||||||
fi
|
fi
|
||||||
|
@ -533,6 +591,7 @@ randomPathFunction(){
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echoContent yellow "path:${customPath}"
|
echoContent yellow "path:${customPath}"
|
||||||
|
echoContent skyBlue "\n----------------------------"
|
||||||
}
|
}
|
||||||
# Nginx伪装博客
|
# Nginx伪装博客
|
||||||
nginxBlog(){
|
nginxBlog(){
|
||||||
|
@ -736,6 +795,7 @@ checkTLStatus(){
|
||||||
# 安装V2Ray、指定版本
|
# 安装V2Ray、指定版本
|
||||||
installV2Ray(){
|
installV2Ray(){
|
||||||
checkCoreStatus
|
checkCoreStatus
|
||||||
|
echoContent red coreInstallStatus:${coreInstallStatus}
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 安装V2Ray"
|
echoContent skyBlue "\n进度 $1/${totalProgress} : 安装V2Ray"
|
||||||
# 首先要卸载掉其余途径安装的V2Ray
|
# 首先要卸载掉其余途径安装的V2Ray
|
||||||
if [[ ! -z `ps -ef|grep -v grep|grep v2ray` ]] && [[ -z `ps -ef|grep -v grep|grep v2ray|grep v2ray-agent` ]]
|
if [[ ! -z `ps -ef|grep -v grep|grep v2ray` ]] && [[ -z `ps -ef|grep -v grep|grep v2ray|grep v2ray-agent` ]]
|
||||||
|
@ -764,7 +824,7 @@ installV2Ray(){
|
||||||
unzip -o /etc/v2ray-agent/v2ray/v2ray-linux-64.zip -d /etc/v2ray-agent/v2ray > /dev/null
|
unzip -o /etc/v2ray-agent/v2ray/v2ray-linux-64.zip -d /etc/v2ray-agent/v2ray > /dev/null
|
||||||
rm -rf /etc/v2ray-agent/v2ray/v2ray-linux-64.zip
|
rm -rf /etc/v2ray-agent/v2ray/v2ray-linux-64.zip
|
||||||
else
|
else
|
||||||
if [[ "${coreType}" = "3" ]]
|
if [[ "${selectCoreType}" = "3" ]]
|
||||||
then
|
then
|
||||||
echoContent green " ---> 锁定v2ray-core版本为v4.32.1"
|
echoContent green " ---> 锁定v2ray-core版本为v4.32.1"
|
||||||
rm -f /etc/v2ray-agent/v2ray/v2ray
|
rm -f /etc/v2ray-agent/v2ray/v2ray
|
||||||
|
@ -801,10 +861,10 @@ installTrojanGo(){
|
||||||
else
|
else
|
||||||
echoContent green " ---> Trojan-Go版本:`/etc/v2ray-agent/trojan/trojan-go --version|awk '{print $2}'|head -1`"
|
echoContent green " ---> Trojan-Go版本:`/etc/v2ray-agent/trojan/trojan-go --version|awk '{print $2}'|head -1`"
|
||||||
|
|
||||||
read -p "是否重新安装?[y/n]:" reInstalTrojanStatus
|
read -p "是否重新安装?[y/n]:" reInstallTrojanStatus
|
||||||
if [[ "${reInstalV2RayStatus}" = "y" ]]
|
if [[ "${reInstallTrojanStatus}" = "y" ]]
|
||||||
then
|
then
|
||||||
rm -rf /etc/v2ray-agent/trojan/trojan-go
|
rm -rf /etc/v2ray-agent/trojan/trojan-go*
|
||||||
installTrojanGo $1
|
installTrojanGo $1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -1156,27 +1216,30 @@ handleTrojanGo(){
|
||||||
# 初始化V2Ray 配置文件
|
# 初始化V2Ray 配置文件
|
||||||
initV2RayConfig(){
|
initV2RayConfig(){
|
||||||
echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置"
|
echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置"
|
||||||
|
|
||||||
if [[ ! -z "${v2rayConfigFilePath}" ]]
|
if [[ ! -z "${v2rayConfigFilePath}" ]]
|
||||||
then
|
then
|
||||||
echo
|
echo
|
||||||
read -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus
|
read -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus
|
||||||
if [[ "${historyUUIDStatus}" = "y" ]]
|
if [[ "${historyUUIDStatus}" = "y" ]]
|
||||||
then
|
then
|
||||||
if [[ "${installType}" = "2" ]]
|
if [[ "${v2rayAgentInstallType}" = "1" ]]
|
||||||
then
|
then
|
||||||
uuid=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.clients[0].id|awk -F '["]' '{print $2}'`
|
uuid=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.clients[0].id|awk -F '["]' '{print $2}'`
|
||||||
elif [[ "${installType}" = "3" ]]
|
elif [[ "${v2rayAgentInstallType}" = "2" ]]
|
||||||
then
|
then
|
||||||
|
uuid=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.clients[0].id|awk -F '["]' '{print $2}'`
|
||||||
uuidDirect=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.clients[1].id|awk -F '["]' '{print $2}'`
|
uuidDirect=`cat ${v2rayConfigFilePath}|jq .inbounds[0].settings.clients[1].id|awk -F '["]' '{print $2}'`
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
uuid=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
||||||
|
uuidDirect=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
uuid=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
echoContent red '\n ---> 无法读取目录'
|
||||||
uuidDirect=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
echoContent red uuid:${uuid}
|
||||||
|
echoContent red uuidDirect:${uuidDirect}
|
||||||
if [[ -z "${uuid}" ]]
|
if [[ -z "${uuid}" ]]
|
||||||
then
|
then
|
||||||
echoContent red "\n ---> uuid读取错误,重新生成"
|
echoContent red "\n ---> uuid读取错误,重新生成"
|
||||||
|
@ -1677,7 +1740,7 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
# VLESS_TCP
|
# VLESS_TCP
|
||||||
if [[ "${coreType}" = "2" ]]
|
if [[ "${selectCoreType}" = "2" ]]
|
||||||
then
|
then
|
||||||
cat << EOF > /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
cat << EOF > /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
||||||
{
|
{
|
||||||
|
@ -1718,7 +1781,7 @@ EOF
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
elif [[ "${coreType}" = "3" ]]
|
elif [[ "${selectCoreType}" = "3" ]]
|
||||||
then
|
then
|
||||||
|
|
||||||
cat << EOF > /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
cat << EOF > /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json
|
||||||
|
@ -1819,7 +1882,7 @@ customCDNIP(){
|
||||||
echoContent yellow " 移动:104.19.41.56"
|
echoContent yellow " 移动:104.19.41.56"
|
||||||
echoContent yellow " 联通:104.16.160.136"
|
echoContent yellow " 联通:104.16.160.136"
|
||||||
echoContent yellow " 电信:104.17.78.198"
|
echoContent yellow " 电信:104.17.78.198"
|
||||||
echoContent skyBlue "-------------------------------------------------------------"
|
echoContent skyBlue "----------------------------"
|
||||||
read -p '是否使用?[y/n]:' dnsProxy
|
read -p '是否使用?[y/n]:' dnsProxy
|
||||||
if [[ "${dnsProxy}" = "y" ]]
|
if [[ "${dnsProxy}" = "y" ]]
|
||||||
then
|
then
|
||||||
|
@ -1938,10 +2001,12 @@ defaultBase64Code(){
|
||||||
|
|
||||||
# 账号
|
# 账号
|
||||||
showAccounts(){
|
showAccounts(){
|
||||||
|
initInstallType
|
||||||
showStatus=
|
showStatus=
|
||||||
local host=
|
# local host=
|
||||||
|
echo v2rayAgentInstallType:${v2rayAgentInstallType}
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 账号"
|
echoContent skyBlue "\n进度 $1/${totalProgress} : 账号"
|
||||||
if [[ "${installType}" = "2" ]]
|
if [[ "${v2rayAgentInstallType}" = "1" ]]
|
||||||
then
|
then
|
||||||
showStatus=true
|
showStatus=true
|
||||||
# VLESS tcp
|
# VLESS tcp
|
||||||
|
@ -1973,33 +2038,33 @@ showAccounts(){
|
||||||
local vmessTCPID=`echo ${vmessTCP}|jq .settings.clients[0].id`
|
local vmessTCPID=`echo ${vmessTCP}|jq .settings.clients[0].id`
|
||||||
local vmessTCPEmail="`echo ${vmessTCP}|jq .settings.clients[0].email|awk -F '["]' '{print $2}'`"
|
local vmessTCPEmail="`echo ${vmessTCP}|jq .settings.clients[0].email|awk -F '["]' '{print $2}'`"
|
||||||
local vmessTCPath=`echo ${vmessTCP}|jq .streamSettings.tcpSettings.header.request.path[0]`
|
local vmessTCPath=`echo ${vmessTCP}|jq .streamSettings.tcpSettings.header.request.path[0]`
|
||||||
|
echoContent red currentHost:${currentHost}
|
||||||
if [[ "${selectCoreType}" = "3" ]]
|
if [[ "${v2rayCoreInstallType}" = "3" ]]
|
||||||
then
|
then
|
||||||
host=`echo ${tcp}|jq .streamSettings.xtlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
# host=`echo ${tcp}|jq .streamSettings.xtlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
||||||
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-origin ==========================="
|
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-origin ==========================="
|
||||||
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${host}:${port}" ${add}
|
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${currentHost}:${port}" ${add}
|
||||||
|
|
||||||
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-direct ==========================="
|
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-direct ==========================="
|
||||||
defaultBase64Code vlesstcp ${tcpDirectEmail} "${tcpIDirect}" "${host}:${port}" ${add}
|
defaultBase64Code vlesstcp ${tcpDirectEmail} "${tcpIDirect}" "${currentHost}:${port}" ${add}
|
||||||
|
|
||||||
elif [[ "${selectCoreType}" = "2" ]]
|
elif [[ "${v2rayCoreInstallType}" = "2" ]]
|
||||||
then
|
then
|
||||||
host=`echo ${tcp}|jq .streamSettings.tlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
# host=`echo ${tcp}|jq .streamSettings.tlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
||||||
echoContent skyBlue "\n============================ VLESS TCP TLS ======================================="
|
echoContent skyBlue "\n============================ VLESS TCP TLS ======================================="
|
||||||
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${host}:${port}" ${add}
|
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${currentHost}:${port}" ${add}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echoContent skyBlue "\n================================ VLESS WS TLS CDN ================================"
|
echoContent skyBlue "\n================================ VLESS WS TLS CDN ================================"
|
||||||
defaultBase64Code vlessws ${vlessWSEmail} "${vlessWSID}" "${host}:${port}" "${vlessWSPath}" ${CDNADD}
|
defaultBase64Code vlessws ${vlessWSEmail} "${vlessWSID}" "${currentHost}:${port}" "${vlessWSPath}" ${CDNADD}
|
||||||
|
|
||||||
echoContent skyBlue "\n================================ VMess WS TLS CDN ================================"
|
echoContent skyBlue "\n================================ VMess WS TLS CDN ================================"
|
||||||
defaultBase64Code vmessws ${wsEmail} "${wsID}" "${host}:${port}" "${wsPath}" ${CDNADD}
|
defaultBase64Code vmessws ${wsEmail} "${wsID}" "${currentHost}:${port}" "${wsPath}" ${CDNADD}
|
||||||
|
|
||||||
echoContent skyBlue "\n================================= VMess TCP TLS ================================="
|
echoContent skyBlue "\n================================= VMess TCP TLS ================================="
|
||||||
defaultBase64Code vmesstcp ${vmessTCPEmail} "${vmessTCPID}" "${host}:${port}" "${vmessTCPath}" "${host}"
|
defaultBase64Code vmesstcp ${vmessTCPEmail} "${vmessTCPID}" "${currentHost}:${port}" "${vmessTCPath}" "${currentHost}"
|
||||||
|
|
||||||
elif [[ ! -z "${selectCustomInstallType}" ]]
|
elif [[ "${v2rayAgentInstallType}" = "2" ]]
|
||||||
then
|
then
|
||||||
showStatus=true
|
showStatus=true
|
||||||
|
|
||||||
|
@ -2014,25 +2079,25 @@ showAccounts(){
|
||||||
local tcpIDirect=`echo ${tcp}|jq .settings.clients[1].id`
|
local tcpIDirect=`echo ${tcp}|jq .settings.clients[1].id`
|
||||||
local tcpDirectEmail="`echo ${tcp}|jq .settings.clients[1].email|awk -F '["]' '{print $2}'`"
|
local tcpDirectEmail="`echo ${tcp}|jq .settings.clients[1].email|awk -F '["]' '{print $2}'`"
|
||||||
|
|
||||||
if [[ "${selectCoreType}" = "3" ]]
|
if [[ "${v2rayCoreInstallType}" = "3" ]]
|
||||||
then
|
then
|
||||||
host=`echo ${tcp}|jq .streamSettings.xtlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
# host=`echo ${tcp}|jq .streamSettings.xtlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
||||||
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-origin ==========================="
|
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-origin ==========================="
|
||||||
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${host}:${port}" ${add}
|
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${currentHost}:${port}" ${add}
|
||||||
|
|
||||||
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-direct ==========================="
|
echoContent skyBlue "\n============================ VLESS TCP TLS/XTLS-direct ==========================="
|
||||||
defaultBase64Code vlesstcp ${tcpDirectEmail} "${tcpIDirect}" "${host}:${port}" ${add}
|
defaultBase64Code vlesstcp ${tcpDirectEmail} "${tcpIDirect}" "${currentHost}:${port}" ${add}
|
||||||
|
|
||||||
elif [[ "${selectCoreType}" = "2" ]]
|
elif [[ "${v2rayCoreInstallType}" = "2" ]]
|
||||||
then
|
then
|
||||||
host=`echo ${tcp}|jq .streamSettings.tlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
# host=`echo ${tcp}|jq .streamSettings.tlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`
|
||||||
echoContent skyBlue "\n============================ VLESS TCP TLS ======================================="
|
echoContent skyBlue "\n============================ VLESS TCP TLS ======================================="
|
||||||
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${host}:${port}" ${add}
|
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${currentHost}:${port}" ${add}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -z "${selectCustomInstallType}" ]]
|
if [[ ! -z "${currentCustomInstallType}" ]]
|
||||||
then
|
then
|
||||||
if [[ ! -z `echo ${selectCustomInstallType}|grep 1` ]]
|
if [[ ! -z `echo ${currentCustomInstallType}|grep 1` ]]
|
||||||
then
|
then
|
||||||
# VLESS ws
|
# VLESS ws
|
||||||
local vlessWS=`cat /etc/v2ray-agent/v2ray/conf/03_VLESS_WS_inbounds.json|jq .inbounds[0]`
|
local vlessWS=`cat /etc/v2ray-agent/v2ray/conf/03_VLESS_WS_inbounds.json|jq .inbounds[0]`
|
||||||
|
@ -2042,9 +2107,9 @@ showAccounts(){
|
||||||
local vlessWSPath=`echo ${vlessWS}|jq .streamSettings.wsSettings.path`
|
local vlessWSPath=`echo ${vlessWS}|jq .streamSettings.wsSettings.path`
|
||||||
|
|
||||||
echoContent skyBlue "\n================================ VLESS WS TLS CDN ================================"
|
echoContent skyBlue "\n================================ VLESS WS TLS CDN ================================"
|
||||||
defaultBase64Code vlessws ${vlessWSEmail} "${vlessWSID}" "${host}:${port}" "${vlessWSPath}" ${CDNADD}
|
defaultBase64Code vlessws ${vlessWSEmail} "${vlessWSID}" "${currentHost}:${port}" "${vlessWSPath}" ${CDNADD}
|
||||||
fi
|
fi
|
||||||
if [[ ! -z `echo ${selectCustomInstallType}|grep 2` ]]
|
if [[ ! -z `echo ${currentCustomInstallType}|grep 2` ]]
|
||||||
then
|
then
|
||||||
|
|
||||||
local vmessTCP=`cat /etc/v2ray-agent/v2ray/conf/04_VMess_TCP_inbounds.json|jq .inbounds[0]`
|
local vmessTCP=`cat /etc/v2ray-agent/v2ray/conf/04_VMess_TCP_inbounds.json|jq .inbounds[0]`
|
||||||
|
@ -2053,9 +2118,9 @@ showAccounts(){
|
||||||
local vmessTCPath=`echo ${vmessTCP}|jq .streamSettings.tcpSettings.header.request.path[0]`
|
local vmessTCPath=`echo ${vmessTCP}|jq .streamSettings.tcpSettings.header.request.path[0]`
|
||||||
|
|
||||||
echoContent skyBlue "\n================================= VMess TCP TLS ================================="
|
echoContent skyBlue "\n================================= VMess TCP TLS ================================="
|
||||||
defaultBase64Code vmesstcp ${vmessTCPEmail} "${vmessTCPID}" "${host}:${port}" "${vmessTCPath}" "${host}"
|
defaultBase64Code vmesstcp ${vmessTCPEmail} "${vmessTCPID}" "${currentHost}:${port}" "${vmessTCPath}" "${currentHost}"
|
||||||
fi
|
fi
|
||||||
if [[ ! -z `echo ${selectCustomInstallType}|grep 3` ]]
|
if [[ ! -z `echo ${currentCustomInstallType}|grep 3` ]]
|
||||||
then
|
then
|
||||||
|
|
||||||
local ws=`cat /etc/v2ray-agent/v2ray/conf/05_VMess_WS_inbounds.json|jq .inbounds[0]`
|
local ws=`cat /etc/v2ray-agent/v2ray/conf/05_VMess_WS_inbounds.json|jq .inbounds[0]`
|
||||||
|
@ -2064,7 +2129,7 @@ showAccounts(){
|
||||||
local wsPath=`echo ${ws}|jq .streamSettings.wsSettings.path`
|
local wsPath=`echo ${ws}|jq .streamSettings.wsSettings.path`
|
||||||
|
|
||||||
echoContent skyBlue "\n================================ VMess WS TLS CDN ================================"
|
echoContent skyBlue "\n================================ VMess WS TLS CDN ================================"
|
||||||
defaultBase64Code vmessws ${wsEmail} "${wsID}" "${host}:${port}" "${wsPath}" ${CDNADD}
|
defaultBase64Code vmessws ${wsEmail} "${wsID}" "${currentHost}:${port}" "${wsPath}" ${CDNADD}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -2076,14 +2141,14 @@ showAccounts(){
|
||||||
local trojanGoPath=`cat /etc/v2ray-agent/trojan/config_full.json|jq .websocket.path|awk -F '["]' '{print $2}'`
|
local trojanGoPath=`cat /etc/v2ray-agent/trojan/config_full.json|jq .websocket.path|awk -F '["]' '{print $2}'`
|
||||||
local trojanGoAdd=`cat /etc/v2ray-agent/trojan/config_full.json|jq .websocket.add|awk -F '["]' '{print $2}'`
|
local trojanGoAdd=`cat /etc/v2ray-agent/trojan/config_full.json|jq .websocket.add|awk -F '["]' '{print $2}'`
|
||||||
echoContent skyBlue "\n================================== Trojan TLS =================================="
|
echoContent skyBlue "\n================================== Trojan TLS =================================="
|
||||||
defaultBase64Code trojan trojan ${trojanUUID} ${host}
|
defaultBase64Code trojan trojan ${trojanUUID} ${currentHost}
|
||||||
|
|
||||||
echoContent skyBlue "\n================================ Trojan WS TLS ================================"
|
echoContent skyBlue "\n================================ Trojan WS TLS ================================"
|
||||||
if [[ -z ${trojanGoAdd} ]]
|
if [[ -z ${trojanGoAdd} ]]
|
||||||
then
|
then
|
||||||
trojanGoAdd=${host}
|
trojanGoAdd=${currentHost}
|
||||||
fi
|
fi
|
||||||
defaultBase64Code trojangows trojan ${trojanUUID} ${host} ${trojanGoPath} ${trojanGoAdd}
|
defaultBase64Code trojangows trojan ${trojanUUID} ${currentHost} ${trojanGoPath} ${trojanGoAdd}
|
||||||
fi
|
fi
|
||||||
if [[ -z ${showStatus} ]]
|
if [[ -z ${showStatus} ]]
|
||||||
then
|
then
|
||||||
|
@ -2134,7 +2199,7 @@ unInstall(){
|
||||||
# 修改V2Ray CDN节点
|
# 修改V2Ray CDN节点
|
||||||
updateV2RayCDN(){
|
updateV2RayCDN(){
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 修改CDN节点"
|
echoContent skyBlue "\n进度 $1/${totalProgress} : 修改CDN节点"
|
||||||
if [[ ! -z "${installType}" ]]
|
if [[ ! -z "${v2rayAgentInstallType}" ]]
|
||||||
then
|
then
|
||||||
|
|
||||||
local add=`cat ${v2rayConfigFilePath}|grep -v grep|grep add`
|
local add=`cat ${v2rayConfigFilePath}|grep -v grep|grep add`
|
||||||
|
@ -2212,7 +2277,7 @@ updateV2RayCDN(){
|
||||||
resetUUID(){
|
resetUUID(){
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 重置UUID"
|
echoContent skyBlue "\n进度 $1/${totalProgress} : 重置UUID"
|
||||||
local resetStatus=false
|
local resetStatus=false
|
||||||
if [[ ! -z "${installType}" ]] && [[ -z "${currentCustomInstallType}" ]]
|
if [[ ! -z "${v2rayAgentInstallType}" ]] && [[ -z "${currentCustomInstallType}" ]]
|
||||||
then
|
then
|
||||||
newUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
newUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
||||||
newDirectUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
newDirectUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
||||||
|
@ -2251,7 +2316,7 @@ resetUUID(){
|
||||||
handleV2Ray stop
|
handleV2Ray stop
|
||||||
handleV2Ray start
|
handleV2Ray start
|
||||||
resetStatus=true
|
resetStatus=true
|
||||||
elif [[ ! -z "${installType}" ]] && [[ ! -z "${currentCustomInstallType}" ]]
|
elif [[ ! -z "${v2rayAgentInstallType}" ]] && [[ ! -z "${currentCustomInstallType}" ]]
|
||||||
then
|
then
|
||||||
newUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
newUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
||||||
newDirectUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
newDirectUUID=`/etc/v2ray-agent/v2ray/v2ctl uuid`
|
||||||
|
@ -2333,6 +2398,9 @@ resetUUID(){
|
||||||
fi
|
fi
|
||||||
if [[ "${resetStatus}" = "true" ]]
|
if [[ "${resetStatus}" = "true" ]]
|
||||||
then
|
then
|
||||||
|
initInstallType
|
||||||
|
initConfigHostPath
|
||||||
|
initCustomInstallType
|
||||||
showAccounts 1
|
showAccounts 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -2493,6 +2561,9 @@ customInstall(){
|
||||||
handleV2Ray start
|
handleV2Ray start
|
||||||
# 生成账号
|
# 生成账号
|
||||||
checkGFWStatue 15
|
checkGFWStatue 15
|
||||||
|
initInstallType
|
||||||
|
initConfigHostPath
|
||||||
|
initCustomInstallType
|
||||||
showAccounts 16
|
showAccounts 16
|
||||||
else
|
else
|
||||||
echoContent red " ---> 输入不合法"
|
echoContent red " ---> 输入不合法"
|
||||||
|
@ -2508,8 +2579,8 @@ selectCoreInstall(){
|
||||||
echoContent yellow "2.v2ray-core"
|
echoContent yellow "2.v2ray-core"
|
||||||
echoContent yellow "3.v2ray-core[XTLS]"
|
echoContent yellow "3.v2ray-core[XTLS]"
|
||||||
echoContent red "=============================================================="
|
echoContent red "=============================================================="
|
||||||
read -p "请选择:" coreType
|
read -p "请选择:" selectCoreType
|
||||||
case ${coreType} in
|
case ${selectCoreType} in
|
||||||
1)
|
1)
|
||||||
echoContent red ' ---> 暂无'
|
echoContent red ' ---> 暂无'
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -2558,6 +2629,9 @@ v2rayCoreInstall(){
|
||||||
handleTrojanGo start
|
handleTrojanGo start
|
||||||
# 生成账号
|
# 生成账号
|
||||||
checkGFWStatue 16
|
checkGFWStatue 16
|
||||||
|
initInstallType
|
||||||
|
initConfigHostPath
|
||||||
|
initCustomInstallType
|
||||||
showAccounts 17
|
showAccounts 17
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2565,7 +2639,6 @@ v2rayCoreInstall(){
|
||||||
xrayCoreInstall(){
|
xrayCoreInstall(){
|
||||||
customInstallType=
|
customInstallType=
|
||||||
totalProgress=17
|
totalProgress=17
|
||||||
mkdirTools 1
|
|
||||||
installTools 2
|
installTools 2
|
||||||
# 申请tls
|
# 申请tls
|
||||||
initTLSNginxConfig 3
|
initTLSNginxConfig 3
|
||||||
|
@ -2593,6 +2666,9 @@ xrayCoreInstall(){
|
||||||
handleTrojanGo start
|
handleTrojanGo start
|
||||||
# 生成账号
|
# 生成账号
|
||||||
checkGFWStatue 16
|
checkGFWStatue 16
|
||||||
|
initInstallType
|
||||||
|
initConfigHostPath
|
||||||
|
initCustomInstallType
|
||||||
showAccounts 17
|
showAccounts 17
|
||||||
}
|
}
|
||||||
# 主菜单
|
# 主菜单
|
||||||
|
@ -2623,7 +2699,6 @@ menu(){
|
||||||
echoContent red "=============================================================="
|
echoContent red "=============================================================="
|
||||||
mkdirTools
|
mkdirTools
|
||||||
aliasInstall
|
aliasInstall
|
||||||
judgeCoreType
|
|
||||||
read -p "请选择:" selectInstallType
|
read -p "请选择:" selectInstallType
|
||||||
case ${selectInstallType} in
|
case ${selectInstallType} in
|
||||||
1)
|
1)
|
||||||
|
|
Loading…
Reference in New Issue