From e166148e87eddadb28984291842bbd707fcd28d2 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Thu, 21 May 2026 16:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81,=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/uuid.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/uuid.sh b/bin/uuid.sh index 3db3946..4573a36 100644 --- a/bin/uuid.sh +++ b/bin/uuid.sh @@ -1,15 +1,14 @@ #!/bin/bash update_uuid(){ - local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径 - local config_file="$script_dir/../config/config.json" + local SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径 + local CONFIG_FILE="$SCRIPT_DIR/../config/config.json" # 生成 UUID - local uuid=$(cat /proc/sys/kernel/random/uuid) + local UUID=$(cat /proc/sys/kernel/random/uuid) # 修改 UUID - sed -i 's/你的UUID/'"$uuid"'/g' "$config_file" + sed -i 's/你的UUID/'"$UUID"'/g' "$CONFIG_FILE" echo "设置UUID成功." } -