From cf58e785f8a6a80dfbe6d7aa15092b7460750d52 Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 15 May 2024 23:09:23 +0800 Subject: [PATCH] update --- bin/update_uuid.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/update_uuid.sh b/bin/update_uuid.sh index f993147..d7adf5f 100644 --- a/bin/update_uuid.sh +++ b/bin/update_uuid.sh @@ -1,16 +1,16 @@ #!/bin/bash -script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 -config_dir="$script_dir/../conf" +SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 +CONFIG_DIR="$SCRIPT_DIR/../conf" # 生成 UUID -uuid=$(xray uuid) +UUID=$(xray uuid) # 使用 jq 修改 JSON 文件 -jq ".inbounds[0].settings.clients[0].id=\"$uuid\"" $config_dir/config.json > $config_dir/config.json_tmp +jq ".inbounds[0].settings.clients[0].id=\"$UUID\"" $CONFIG_DIR/config.json > $CONFIG_DIR/config.json_tmp # 替换原始文件 -mv $config_dir/config.json_tmp $config_dir/config.json +mv $CONFIG_DIR/config.json_tmp $CONFIG_DIR/config.json # 验证结果 echo "设置UUID成功."