fix(脚本): 修改VMess ws订阅、查看账号显示错误问题

pull/534/merge
mack-a 2021-09-06 15:07:12 +08:00
parent e4eb30df53
commit 42e5b758d8
1 changed files with 10 additions and 13 deletions

View File

@ -1005,9 +1005,9 @@ renewalTLS() {
modifyTime=$(date +%s -d "${modifyTime}") modifyTime=$(date +%s -d "${modifyTime}")
currentTime=$(date +%s) currentTime=$(date +%s)
((stampDiff=currentTime - modifyTime)) ((stampDiff = currentTime - modifyTime))
((days=stampDiff / 86400)) ((days = stampDiff / 86400))
((remainingDays=90 - days)) ((remainingDays = 90 - days))
tlsStatus=${remainingDays} tlsStatus=${remainingDays}
if [[ ${remainingDays} -le 0 ]]; then if [[ ${remainingDays} -le 0 ]]; then
@ -1042,9 +1042,9 @@ checkTLStatus() {
modifyTime=$(date +%s -d "${modifyTime}") modifyTime=$(date +%s -d "${modifyTime}")
currentTime=$(date +%s) currentTime=$(date +%s)
((stampDiff=currentTime - modifyTime)) ((stampDiff = currentTime - modifyTime))
((days=stampDiff / 86400)) ((days = stampDiff / 86400))
((remainingDays=90 - days)) ((remainingDays = 90 - days))
tlsStatus=${remainingDays} tlsStatus=${remainingDays}
if [[ ${remainingDays} -le 0 ]]; then if [[ ${remainingDays} -le 0 ]]; then
@ -2407,15 +2407,12 @@ EOF
echoContent yellow " ---> 二维码 Trojan(Trojan+TCP+TLS/xtls-rprx-splice)" echoContent yellow " ---> 二维码 Trojan(Trojan+TCP+TLS/xtls-rprx-splice)"
echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=trojan%3A%2F%2F${id}%40${host}%3A${port}%3Fencryption%3Dnone%26security%3Dxtls%26type%3Dtcp%26${host}%3D${host}%26headerType%3Dnone%26sni%3D${host}%26flow%3Dxtls-rprx-splice%23${email}\n" echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=trojan%3A%2F%2F${id}%40${host}%3A${port}%3Fencryption%3Dnone%26security%3Dxtls%26type%3Dtcp%26${host}%3D${host}%26headerType%3Dnone%26sni%3D${host}%26flow%3Dxtls-rprx-splice%23${email}\n"
elif elif [[ "${type}" == "vmessws" ]]; then
[[ "${type}" == "vmessws" ]] qrCodeBase64Default=$(echo -n "{\"port\":${port},\"ps\":\"${email}\",\"tls\":\"tls\",\"id\":\"${id}\",\"aid\":0,\"v\":2,\"host\":\"${host}\",\"type\":\"none\",\"path\":\"/${path}\",\"net\":\"ws\",\"add\":\"${add}\",\"allowInsecure\":0,\"method\":\"none\",\"peer\":\"${host}\",\"sni\":\"${host}\"}" | base64 -w 0)
then
qrCodeBase64Default=$(echo -n "{\"port\":${port},\"ps\":\"${email}\",\"tls\":\"tls\",\"id\":\"${id}\",\"aid\":0,\"v\":2,\"host\":\"${host}\",\"type\":\"none\",\"path\":\"/${path}\",\"net\":\"ws\",\"add\":\"${add}\",\"allowInsecure\":0,\"method\":\"none\",\"peer\":\"${host}\",\"sni\":\"${host}\"}" | sed 's#/#\\\/#g' | base64)
qrCodeBase64Default="${qrCodeBase64Default// /}" qrCodeBase64Default="${qrCodeBase64Default// /}"
echoContent yellow " ---> 通用json(VMess+WS+TLS)" echoContent yellow " ---> 通用json(VMess+WS+TLS)"
echoContent green " {\"port\":${port},\"ps\":\"${email}\",\"tls\":\"tls\",\"id\":\"${id}\",\"aid\":0,\"v\":2,\"host\":'${host}',\"type\":\"none\",\"path\":\"${path}\",\"net\":\"ws\",\"add\":\"${add}\",\"allowInsecure\":0,\"method\":\"none\",\"peer\":\"${host}\",\"sni\":\"${host}\"}\n" echoContent green " {\"port\":${port},\"ps\":\"${email}\",\"tls\":\"tls\",\"id\":\"${id}\",\"aid\":0,\"v\":2,\"host\":\"${host}\",\"type\":\"none\",\"path\":\"${path}\",\"net\":\"ws\",\"add\":\"${add}\",\"allowInsecure\":0,\"method\":\"none\",\"peer\":\"${host}\",\"sni\":\"${host}\"}\n"
echoContent yellow " ---> 通用vmess(VMess+WS+TLS)链接" echoContent yellow " ---> 通用vmess(VMess+WS+TLS)链接"
echoContent green " vmess://${qrCodeBase64Default}\n" echoContent green " vmess://${qrCodeBase64Default}\n"
echoContent yellow " ---> 二维码 vmess(VMess+WS+TLS)" echoContent yellow " ---> 二维码 vmess(VMess+WS+TLS)"
@ -4125,7 +4122,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.5.31" echoContent green "当前版本v2.5.32"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus