feat(脚本): 优化安装时UUID的流程

pull/534/merge
mack-a 2021-07-03 16:40:14 +08:00
parent 01c2abe45b
commit cf9793fc4d
1 changed files with 18 additions and 16 deletions

View File

@ -930,7 +930,7 @@ randomPathFunction() {
fi fi
fi fi
echoContent yellow "path${currentPath}" echoContent yellow "\n path${currentPath}"
echoContent skyBlue "\n----------------------------" echoContent skyBlue "\n----------------------------"
} }
# Nginx伪装博客 # Nginx伪装博客
@ -1626,6 +1626,7 @@ handleTrojanGo() {
initV2RayConfig() { initV2RayConfig() {
echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置" echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置"
echo echo
read -r -p "是否自定义UUID [y/n]:" customUUIDStatus read -r -p "是否自定义UUID [y/n]:" customUUIDStatus
echo echo
if [[ "${customUUIDStatus}" == "y" ]]; then if [[ "${customUUIDStatus}" == "y" ]]; then
@ -2066,25 +2067,27 @@ initXrayFrontingConfig(){
initXrayConfig() { initXrayConfig() {
echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化Xray配置" echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化Xray配置"
echo echo
read -r -p "是否自定义UUID [y/n]:" customUUIDStatus local uuid=
echo if [[ -n "${currentUUID}" ]]; then
if [[ "${customUUIDStatus}" == "y" ]]; then
read -r -p "请输入合法的UUID:" currentCustomUUID
if [[ -n "${currentCustomUUID}" ]]; then
uuid=${currentCustomUUID}
fi
fi
if [[ -n "${currentUUID}" && -z "${uuid}" ]]; then
read -r -p "读取到上次安装记录是否使用上次安装时的UUID [y/n]:" historyUUIDStatus read -r -p "读取到上次安装记录是否使用上次安装时的UUID [y/n]:" historyUUIDStatus
if [[ "${historyUUIDStatus}" == "y" ]]; then if [[ "${historyUUIDStatus}" == "y" ]]; then
uuid=${currentUUID} uuid=${currentUUID}
echoContent green "\n ---> 使用成功"
else else
uuid=$(/etc/v2ray-agent/xray/xray uuid) uuid=$(/etc/v2ray-agent/xray/xray uuid)
fi fi
elif [[ -z "${uuid}" ]]; then fi
uuid=$(/etc/v2ray-agent/xray/xray uuid)
if [[ -z "${uuid}" ]];then
echoContent yellow "请输入自定义UUID[需合法][回车]随机UUID"
read -r -p 'UUID:' customUUID
if [[ -n ${customUUID} ]];then
uuid=${customUUID}
else
uuid=$(/etc/v2ray-agent/xray/xray uuid)
fi
fi fi
if [[ -z "${uuid}" ]]; then if [[ -z "${uuid}" ]]; then
@ -2092,7 +2095,7 @@ initXrayConfig() {
uuid=$(/etc/v2ray-agent/xray/xray uuid) uuid=$(/etc/v2ray-agent/xray/xray uuid)
fi fi
echoContent green "\n ---> 使用成功" echoContent yellow "\n ${uuid}"
rm -rf /etc/v2ray-agent/xray/conf/* rm -rf /etc/v2ray-agent/xray/conf/*
@ -2283,7 +2286,6 @@ EOF
# trojan_grpc # trojan_grpc
if echo ${selectCustomInstallType} | grep -q 2 || [[ "$1" == "all" ]]; then if echo ${selectCustomInstallType} | grep -q 2 || [[ "$1" == "all" ]]; then
echo selectCustomInstallType:${selectCustomInstallType}
if ! echo ${selectCustomInstallType} | grep -q 5 && [[ -n ${selectCustomInstallType} ]];then if ! echo ${selectCustomInstallType} | grep -q 5 && [[ -n ${selectCustomInstallType} ]];then
fallbacksList=${fallbacksList//31302/31304} fallbacksList=${fallbacksList//31302/31304}
fi fi