From f4808e23059a48541f926f07c2e8f1f7fdb99d39 Mon Sep 17 00:00:00 2001 From: 233boy <31657650+233boy@users.noreply.github.com> Date: Mon, 11 Mar 2019 20:47:19 +0800 Subject: [PATCH] fix qrcode fix --- src/qr.sh | 17 +++++++++++++++++ v2ray.sh | 38 +++----------------------------------- 2 files changed, 20 insertions(+), 35 deletions(-) create mode 100644 src/qr.sh diff --git a/src/qr.sh b/src/qr.sh new file mode 100644 index 0000000..b1443ed --- /dev/null +++ b/src/qr.sh @@ -0,0 +1,17 @@ +_qr_create() { + local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)" + local link="https://233boy.github.io/tools/qr.html#${vmess}" + echo + echo "---------- V2Ray 二维码链接 适用于 V2RayNG v0.4.1+ / Kitsunebi -------------" + echo + echo -e ${cyan}$link${none} + echo + echo + echo -e "$red 友情提醒: 请务必核对扫码结果 (V2RayNG 除外) $none" + echo + echo + echo " V2Ray 客户端使用教程: https://v2ray6.com/post/4/" + echo + echo + rm -rf /etc/v2ray/vmess_qr.json +} diff --git a/v2ray.sh b/v2ray.sh index dda9f7b..9366200 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v3.07" +_version="v3.08" cmd="apt-get" @@ -2294,40 +2294,8 @@ get_v2ray_config_qr_link() { create_vmess_URL_config - echo - echo -e "$green 正在生成链接.... 稍等片刻即可....$none" - echo - local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | tr -d '\n' | base64 -w 0)" - echo $vmess | tr -d '\n' >/etc/v2ray/vmess.txt - cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png - local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64 -w 0) - local link=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random}_v2ray6_v2ray.png") - if [[ $link ]]; then - echo - echo "---------- V2Ray 二维码链接 -------------" - echo - echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan$link$none" - echo - echo - echo -e "$red 友情提醒: 请务必核对扫码结果 (V2RayNG 除外) $none" - echo - echo - echo " V2Ray 客户端使用教程: https://v2ray6.com/post/4/" - echo - echo "备注...链接将在 14 天后失效" - echo - echo "提醒...请不要把链接分享出去...除非你有特别的理由...." - echo - else - echo - echo -e "$red 哎呀呀呀...出错咯...$none" - echo - echo -e "请尝试使用${cyan} v2ray qr ${none}重新生成" - echo - fi - rm -rf /tmp/233blog_v2ray.png - rm -rf /etc/v2ray/vmess_qr.json - rm -rf /etc/v2ray/vmess.txt + _load qr.sh + _qr_create } get_v2ray_vmess_URL_link() { create_vmess_URL_config