This commit is contained in:
vincent
2024-05-15 22:41:02 +08:00
parent aba157d578
commit 8da4cdbbee
3 changed files with 20 additions and 11 deletions
+6 -4
View File
@@ -12,16 +12,18 @@ if ! command -v qrencode &> /dev/null; then
exit 1
fi
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
config_dir="$script_dir/../config" # 配置文件绝对路径
# 获取本机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)
UUID=$(jq -r '.inbounds[0].settings.clients[0].id' $config_dir/config.json)
PORT=$(jq -r '.inbounds[0].port' $config_dir/config.json)
DEST=$(jq -r '.inbounds[0].streamSettings.realitySettings.dest' $config_dir/config.json)
SNI=$(echo $DEST | awk -F ':' '{print $1}')
NETWORK="tcp"
PUBLIC_KEY=$(cat ../conf/key.txt | grep "Public" | awk -F ': ' '{print $2}')
PUBLIC_KEY=$(cat $config_dir/key.txt | grep "Public" | awk -F ': ' '{print $2}')
# 打印配置信息
echo -e "\033[32m" # config info with green color