Merge pull request #156 from cutelua/dev

Dev merge qr fix
pull/159/head
233boy 6 years ago committed by GitHub
commit e8b9e795e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      install.sh
  2. 10
      src/init.sh
  3. 7
      src/jqcmd.sh
  4. 17
      src/qr.sh
  5. 59
      v2ray.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() {

@ -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() {

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

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

Loading…
Cancel
Save