feat(脚本): 优化重装时读取不到上一次的配置文件时的提示

pull/534/merge
mack-a 2022-03-18 11:51:00 +08:00
parent 4388a8f204
commit a422f4cd21
1 changed files with 3 additions and 6 deletions

View File

@ -1639,17 +1639,14 @@ handleXray() {
# 获取clients配置
getClients() {
local path=$1
local addClientsStatus=$2
previousClients=
if [[ ${addClientsStatus} == "true" ]]; then
if [[ ! -f "${path}" ]]; then
echo
echoContent yellow "没有读取到此协议上一次安装的配置文件跳过将采用随机uuid"
echo
read -r -p "是否跳过 [y/n]:" skip
if [[ "${skip}" == "n" ]]; then
exit
fi
local protocol=$(echo "${path}" | awk -F "[_]" '{print $2 $3}')
echoContent yellow "没有读取到此协议[${protocol}]上一次安装的配置文件采用配置文件的第一个uuid"
else
previousClients=$(jq -r ".inbounds[0].settings.clients" "${path}")
fi