fix qrcode fix

pull/159/head
233boy 6 years ago
parent 0cdd7be335
commit f4808e2305
  1. 17
      src/qr.sh
  2. 38
      v2ray.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
}

@ -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

Loading…
Cancel
Save