From b6381cabdf0c60dee0191234a7a39247e1a7bc3d Mon Sep 17 00:00:00 2001 From: 233boy <31657650+233boy@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:17:12 +0800 Subject: [PATCH] fix v2ray client file download and ss qr create --- src/client_file.sh | 12 ++++++++++ src/qr.sh | 12 ++++++++++ v2ray.sh | 60 ++++------------------------------------------ 3 files changed, 29 insertions(+), 55 deletions(-) create mode 100644 src/client_file.sh diff --git a/src/client_file.sh b/src/client_file.sh new file mode 100644 index 0000000..ea2c5cb --- /dev/null +++ b/src/client_file.sh @@ -0,0 +1,12 @@ +_get_client_file() { + local _link="$(cat $v2ray_client_config | tr -d [:space:] | base64 -w0)" + local link="https://233boy.github.io/tools/json.html#${_link}" + echo + echo "---------- V2Ray 客户端配置文件链接 -------------" + echo + echo -e ${cyan}$link${none} + echo + echo " V2Ray 客户端使用教程: https://v2ray6.com/post/4/" + echo + echo +} diff --git a/src/qr.sh b/src/qr.sh index b1443ed..24383a7 100644 --- a/src/qr.sh +++ b/src/qr.sh @@ -15,3 +15,15 @@ _qr_create() { echo rm -rf /etc/v2ray/vmess_qr.json } +_ss_qr() { + local ss_link="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64 -w 0)#v2ray6.com_ss_${ip}" + local link="https://233boy.github.io/tools/qr.html#${ss_link}" + echo + echo "---------- Shadowsocks 二维码链接 -------------" + echo + echo -e "$yellow 链接 = $cyan$link$none" + echo + echo -e " 温馨提示...$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该二维码" + echo + echo +} diff --git a/v2ray.sh b/v2ray.sh index 9366200..9460cd4 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.08" +_version="v3.09" cmd="apt-get" @@ -189,35 +189,9 @@ view_shadowsocks_config_info() { } get_shadowsocks_config_qr_link() { if [[ $shadowsocks ]]; then - echo - echo -e "$green 正在生成链接.... 稍等片刻即可....$none" - echo get_ip - local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64 -w 0)#v2ray6.com_ss_${ip}" - echo "${ss}" >/tmp/233blog_shadowsocks.txt - cat /tmp/233blog_shadowsocks.txt | qrencode -s 50 -o /tmp/233blog_shadowsocks.png - - local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64 -w 0) - local link=$(curl -s --upload-file /tmp/233blog_shadowsocks.png "https://transfer.sh/${random}_v2ray6_shadowsocks.png") - if [[ $link ]]; then - echo - echo "---------- Shadowsocks 二维码链接 -------------" - echo - echo -e "$yellow 链接 = $cyan$link$none" - echo - echo -e " 温馨提示...$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该二维码" - echo - echo "备注...链接将在 14 天后失效" - echo - echo "提醒...请不要把链接分享出去...除非你有特别的理由...." - echo - else - echo - echo -e "$red 哎呀呀呀...出错咯...请重试$none" - echo - fi - rm -rf /tmp/233blog_shadowsocks.png - rm -rf /tmp/233blog_shadowsocks.txt + _load qr.sh + _ss_qr else shadowsocks_config fi @@ -2171,32 +2145,8 @@ get_v2ray_config() { } get_v2ray_config_link() { - echo - echo -e "$green 正在生成链接.... 稍等片刻即可....$none" - echo - local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64 -w 0) - local link=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random}_v2ray6_v2ray.json") - if [[ $link ]]; then - echo - echo "---------- V2Ray 客户端配置文件链接 -------------" - echo - echo -e "$yellow 链接 = $cyan$link$none" - echo - echo -e "$yellow SOCKS 监听端口 = ${cyan}2333${none}" - echo - echo -e "${yellow} HTTP 监听端口 = ${cyan}6666$none" - echo - echo " V2Ray 客户端使用教程: https://v2ray6.com/post/4/" - echo - echo "备注...链接将在 14 天后失效" - echo - echo "提醒...请不要把链接分享出去...除非你有特别的理由...." - echo - else - echo - echo -e "$red 哎呀呀呀...出错咯...请重试$none" - echo - fi + _load client_file.sh + _get_client_file } create_v2ray_config_text() {