32 lines
976 B
Bash
32 lines
976 B
Bash
#!/bin/sh
|
|
|
|
# 获取IP
|
|
IPV4=$(curl -4 -sSL --connect-timeout 3 --retry 2 ip.sb || echo "null")
|
|
|
|
UUID=$(jq -r '.inbounds[0].settings.clients[0].id' ./conf/config.json)
|
|
PORT=$(jq -r '.inbounds[0].port' ./conf/config.json)
|
|
DEST=$(jq -r '.inbounds[0].streamSettings.realitySettings.dest' ./conf/config.json)
|
|
SNI=$(echo $DEST | awk -F ':' '{print $1}')
|
|
NETWORK="tcp"
|
|
PUBLIC_KEY=$(cat ./conf/key.txt | grep "Public" | awk -F ': ' '{print $2}')
|
|
|
|
# config info with green color
|
|
echo -e "\033[32m"
|
|
echo "IPV4: $IPV4"
|
|
echo "UUID: $UUID"
|
|
echo "DEST: $DEST"
|
|
echo "PORT: $PORT"
|
|
echo "PUBLIC_KEY: $PUBLIC_KEY"
|
|
echo "NETWORK: $NETWORK"
|
|
if [ "$IPV4" != "null" ]; then
|
|
SUB_IPV4="vless://$UUID@$IPV4:$PORT?encryption=none&security=reality&type=$NETWORK&sni=$SNI&fp=chrome&pbk=$PUBLIC_KEY&flow=xtls-rprx-vision#wulabing_docker_vless_reality_vision"
|
|
echo "IPV4 订阅连接: $SUB_IPV4"
|
|
echo -e "IPV4 订阅二维码:\n$(echo "$SUB_IPV4" | qrencode -o - -t UTF8)"
|
|
fi
|
|
|
|
echo -e "\033[0m"
|
|
|
|
|
|
|
|
|