diff --git a/install.sh b/install.sh index afc97b3..fa5ae20 100644 --- a/install.sh +++ b/install.sh @@ -872,11 +872,11 @@ get_ip() { [[ -z $ip ]] && ip=$(curl -4 -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") [[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit - v6ip=$(curl -6 -s https://ifconfig.co/ip) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://api.ip.sb/ip) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://ip.seeip.org) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s http://icanhazip.com) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://api.myip.com | cut -d\" -f4) + v6ip=$(curl -m 5 -6 -s https://ifconfig.co/ip) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s https://api.ip.sb/ip) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s https://ip.seeip.org) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s http://icanhazip.com) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s https://api.myip.com | cut -d\" -f4) } error() { diff --git a/src/init.sh b/src/init.sh index d961317..56ef7a1 100644 --- a/src/init.sh +++ b/src/init.sh @@ -79,11 +79,11 @@ get_ip() { [[ -z $ip ]] && ip=$(curl -4 -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") [[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit - v6ip=$(curl -6 -s https://ifconfig.co/ip) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://api.ip.sb/ip) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://ip.seeip.org) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s http://icanhazip.com) - [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://api.myip.com | cut -d\" -f4) + v6ip=$(curl -m 5 -6 -s https://ifconfig.co/ip) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s https://api.ip.sb/ip) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s https://ip.seeip.org) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s http://icanhazip.com) + [[ -z $v6ip ]] && v6ip=$(curl -m 5 -6 -s https://api.myip.com | cut -d\" -f4) } error() { diff --git a/src/jqcmd.sh b/src/jqcmd.sh index c59ea0e..cd20c8a 100644 --- a/src/jqcmd.sh +++ b/src/jqcmd.sh @@ -119,8 +119,11 @@ jq_printvmess() { for CLINTIDX in $( seq 0 $CLTLEN ); do local EMAIL=$(echo $IN | jq 'if .settings.clients['${CLINTIDX}'].email then .settings.clients['${CLINTIDX}'].email else "DEFAULT" end') local _ps="${_MAKPREFIX}${ADDRESS}/${_NETTRIM}" - _green "${EMAIL//\"/} -- ${_ps}" - echo "vmess://"$(echo $IN | jq -c '{"v":"2","ps":"'${_ps}'","add":"'${ADDRESS}'","port":.port,"id":.settings.clients['${CLINTIDX}'].id,"aid":.settings.clients['${CLINTIDX}'].alterId,"net":.streamSettings.network,"type":'${_TYPE}',"host":'${_HOST}',"path":'${_PATH}',"tls":'${_TLS}'}' | base64 -w0) + local _VMESS=$(echo "vmess://"$(echo $IN | jq -c '{"v":"2","ps":"'${_ps}'","add":"'${ADDRESS}'","port":.port,"id":.settings.clients['${CLINTIDX}'].id,"aid":.settings.clients['${CLINTIDX}'].alterId,"net":.streamSettings.network,"type":'${_TYPE}',"host":'${_HOST}',"path":'${_PATH}',"tls":'${_TLS}'}' | base64 -w0)) + _green "VMESS链接(v2rayN/v2rayNG): ${EMAIL//\"/}" + echo ${_VMESS} + _green "二维码链接【浏览器打开】(v2rayN/v2rayNG)" + echo "https://233boy.github.io/tools/qr.html#${_VMESS}" echo done done 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 2354431..62a09b2 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" @@ -1034,7 +1034,7 @@ change_vmess_user () { echo _yellow " ---- 搞定了。" restart_v2ray - _yellow " ---- 翻查多用户的vmess link请用v2ray url查看。" + _yellow " ---- 翻查多用户的vmess link请用v2ray murl查看。" _yellow " ---- 翻查各个用户的流量,可用v2ray traffic查看(重启v2ray后会清空)。" echo @@ -2597,41 +2597,21 @@ 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://${_site}/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_multi_vmess_URL_QR() { + echo "---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 -------------" + get_ip + _load jqcmd.sh + jq_gen_json + jq_printvmess $ip "[233]" + [[ $v6ip ]] && jq_printvmess $v6ip "[233]" + + return +} + get_v2ray_vmess_URL_link() { echo "---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 -------------" @@ -2935,7 +2915,7 @@ menu() { case $choose in 1) view_v2ray_config_info - _yellow " ---- 翻查多用户的vmess link请用v2ray url查看。" + _yellow " ---- 翻查多用户的vmess link请用v2ray murl查看。" break ;; 2) @@ -2999,7 +2979,7 @@ menu) ;; i | info) view_v2ray_config_info - _yellow " ---- 翻查多用户的vmess link请用v2ray url查看。" + _yellow " ---- 翻查多用户的vmess link请用v2ray murl查看。" echo ;; c | config) @@ -3077,6 +3057,9 @@ log) url | URL) get_v2ray_vmess_URL_link ;; +murl | MURL | mqr | MQR) + get_v2ray_multi_vmess_URL_QR + ;; u | update) update_v2ray ;;