fix(脚本): 修改更新证书目录判断、升级版本

pull/534/merge
mack-a 2020-10-19 10:43:53 +08:00
parent b2f7df9daa
commit f273d94f8c
1 changed files with 46 additions and 36 deletions

View File

@ -279,10 +279,10 @@ installTLS(){
then then
echoContent yellow " ---> 检测到错误证书,需重新生成,重新生成中" echoContent yellow " ---> 检测到错误证书,需重新生成,重新生成中"
rm -rf /etc/v2ray-agent/tls/* rm -rf /etc/v2ray-agent/tls/*
installTLS installTLS $1
else else
echoContent green " ---> 检测到证书" echoContent green " ---> 检测到证书"
read -p "是否重新生成[y/n]:" reInstalTLStatus read -p "是否重新生成如未过期请选择n[y/n]:" reInstalTLStatus
if [[ "${reInstalTLStatus}" = "y" ]] if [[ "${reInstalTLStatus}" = "y" ]]
then then
rm -rf /etc/v2ray-agent/tls/* rm -rf /etc/v2ray-agent/tls/*
@ -456,9 +456,16 @@ EOF
# 更新证书 # 更新证书
renewalTLS(){ renewalTLS(){
echoContent skyBlue "\n进度 1/1 : 更新证书" echoContent skyBlue "\n进度 1/1 : 更新证书"
if [[ -d "/etc/v2ray-agent" ]] && [[ -d "/etc/v2ray-agent/v2ray" ]] && [[ -d "/etc/v2ray-agent/tls" ]] && [[ -f "/etc/v2ray-agent/v2ray/config_full.json" ]] && [[ -d "/root/.acme.sh" ]] if [[ -d "/etc/v2ray-agent" ]] && [[ -d "/etc/v2ray-agent/v2ray" ]] && [[ -d "/etc/v2ray-agent/tls" ]] && [[ -d "/root/.acme.sh" ]]
then
if [[ ! -z "${customInstallType}" ]] || [[ -f "/etc/v2ray-agent/v2ray/config_full.json" ]]
then then
tcp=`cat /etc/v2ray-agent/v2ray/config_full.json|jq .inbounds[0]` tcp=`cat /etc/v2ray-agent/v2ray/config_full.json|jq .inbounds[0]`
if [[ -d "/etc/v2ray-agent/v2ray/conf" ]] && [[ -f "/etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json" ]]
then
tcp=`cat /etc/v2ray-agent/v2ray/conf/02_VLESS_TCP_inbounds.json|jq .inbounds[0]`
fi
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}'`
if [[ -d "/root/.acme.sh/${host}_ecc" ]] && [[ -f "/root/.acme.sh/${host}_ecc/${host}.key" ]] && [[ -f "/root/.acme.sh/${host}_ecc/${host}.cer" ]] if [[ -d "/root/.acme.sh/${host}_ecc" ]] && [[ -f "/root/.acme.sh/${host}_ecc/${host}.key" ]] && [[ -f "/root/.acme.sh/${host}_ecc/${host}.cer" ]]
then then
@ -497,6 +504,9 @@ renewalTLS(){
else else
echoContent green " ---> 证书有效" echoContent green " ---> 证书有效"
fi fi
else
echoContent red " ---> 无法找到相应证书路径,请使用脚本重新安装"
fi
else else
echoContent red " ---> 无法找到相应路径,请使用脚本重新安装" echoContent red " ---> 无法找到相应路径,请使用脚本重新安装"
fi fi
@ -2010,7 +2020,7 @@ menu(){
cd cd
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.0.26" echoContent green "当前版本v2.1.0"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:七合一共存脚本" echoContent green "描述:七合一共存脚本"
echoContent red "==============================================================" echoContent red "=============================================================="
@ -2019,7 +2029,7 @@ menu(){
echoContent skyBlue "-------------------------工具管理-----------------------------" echoContent skyBlue "-------------------------工具管理-----------------------------"
echoContent yellow "3.查看账号" echoContent yellow "3.查看账号"
echoContent yellow "4.自动排错 [fail]" echoContent yellow "4.自动排错 [fail]"
echoContent yellow "5.更新证书 [fail]" echoContent yellow "5.更新证书"
echoContent yellow "6.更换CDN节点" echoContent yellow "6.更换CDN节点"
echoContent yellow "7.重置uuid" echoContent yellow "7.重置uuid"
echoContent skyBlue "-------------------------版本管理-----------------------------" echoContent skyBlue "-------------------------版本管理-----------------------------"
@ -2049,9 +2059,9 @@ menu(){
# 4) # 4)
# checkFail 1 # checkFail 1
# ;; # ;;
# 5) 5)
# renewalTLS 1 renewalTLS 1
# ;; ;;
6) 6)
updateV2RayCDN 1 updateV2RayCDN 1
;; ;;