From 88e8c79761ab2ed604c6d213886084e2af4e7d0d Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 15 May 2024 23:05:02 +0800 Subject: [PATCH] update --- bin/print_share_link.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/print_share_link.sh b/bin/print_share_link.sh index 15d9e4b..ff71bc6 100644 --- a/bin/print_share_link.sh +++ b/bin/print_share_link.sh @@ -12,18 +12,18 @@ if ! command -v qrencode &> /dev/null; then exit 1 fi -script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 -config_dir=$(readlink -f "$script_dir/../conf") # 配置文件绝对路径 +SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 +CONFIG_DIR=$(readlink -f "$SCRIPT_DIR/../conf") # 配置文件绝对路径 # 获取本机IP -IPV4=$(curl -4 -sSL --connect-timeout 3 --retry 2 ip.sb || echo "null") +IPV4=$(curl -4 -sSL --connect-timeout 3 --retry 2 ip.sb || echo "null") -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) +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 $config_dir/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