feat(脚本): 完善智能解析dns

pull/534/merge
mack-a 2020-06-05 14:43:15 +08:00
parent a429e1ddfb
commit d30a7e0200
1 changed files with 4 additions and 3 deletions

View File

@ -320,6 +320,7 @@ qrEncode(){
id=`echo ${user}|jq .settings.clients[0].id` id=`echo ${user}|jq .settings.clients[0].id`
aid=`echo ${user}|jq .settings.clients[0].alterId` aid=`echo ${user}|jq .settings.clients[0].alterId`
host="$1" host="$1"
add="$1"
path=`echo ${user}|jq .streamSettings.wsSettings.path` path=`echo ${user}|jq .streamSettings.wsSettings.path`
echoContent red '是否使用DNS智能解析进行自定义CDN IP ?,请选择⬇️' echoContent red '是否使用DNS智能解析进行自定义CDN IP ?,请选择⬇️'
echoContent yellow ' 1.使用 ' echoContent yellow ' 1.使用 '
@ -327,17 +328,17 @@ qrEncode(){
read dnsProxy read dnsProxy
if [[ "${dnsProxy}" = "1" ]] if [[ "${dnsProxy}" = "1" ]]
then then
host="domain04.qiu4.ml" add="domain04.qiu4.ml"
fi fi
echoContent yellow "客户端链接--->\n" echoContent yellow "客户端链接--->\n"
qrCodeBase64=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"64","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${host}'"}'|sed 's#/#\\\/#g'|base64` qrCodeBase64=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"64","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64=`echo ${qrCodeBase64}|sed 's/ //g'` qrCodeBase64=`echo ${qrCodeBase64}|sed 's/ //g'`
echoContent red "通用vmess链接--->" echoContent red "通用vmess链接--->"
echoContent green " vmess://${qrCodeBase64}\n" echoContent green " vmess://${qrCodeBase64}\n"
echo vmess://${qrCodeBase64} > /etc/v2ray/usersv2ray.conf echo vmess://${qrCodeBase64} > /etc/v2ray/usersv2ray.conf
echoContent red "json--->" echoContent red "json--->"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"64","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${host}'"}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"64","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'"}\n'
# | qrencode -t UTF8 # | qrencode -t UTF8
# echo ${qrCodeBase64} # echo ${qrCodeBase64}