From 8d96dab1467a76b68acc91ccb2729095b7b942dd Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Wed, 14 Jan 2026 23:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81,=20?= =?UTF-8?q?=E5=B0=86=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=AF=AD=E5=8F=A5=E6=94=BE=E5=9C=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=96=87=E4=BB=B6=E5=A4=B4=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/create_config.sh | 2 ++ bin/gen_self_tls.sh | 5 ++--- bin/print_share_link.sh | 3 ++- bin/update_domain.sh | 6 +++--- bin/update_obfs_password.sh | 6 ++---- bin/update_password.sh | 6 ++---- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/bin/create_config.sh b/bin/create_config.sh index 2610134..5eb71c8 100644 --- a/bin/create_config.sh +++ b/bin/create_config.sh @@ -1,4 +1,6 @@ #!/bin/bash +source "$(dirname "$0")/utils/base.sh" + create_config_with_tls_cert() { local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/bin/gen_self_tls.sh b/bin/gen_self_tls.sh index a089fa9..bd29d92 100644 --- a/bin/gen_self_tls.sh +++ b/bin/gen_self_tls.sh @@ -1,13 +1,12 @@ #!/bin/bash +source "$(dirname "$0")/utils/jq_util.sh" + # 生成自签名证书 gen_self_tls() { local domain="${1:-bing.com}" local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" local key_dir="$script_dir/../tls/self-tls" - - # 导入utils文件夹中的jq_util.sh脚本 - source "$script_dir/utils/jq_util.sh" # 生成自签名证书 mkdir -p "$key_dir" diff --git a/bin/print_share_link.sh b/bin/print_share_link.sh index 39b7a3c..35cf9b3 100644 --- a/bin/print_share_link.sh +++ b/bin/print_share_link.sh @@ -1,10 +1,11 @@ #!/bin/bash +source "$(dirname "$0")/utils/base.sh" + print_share_link() { local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" local config_dir=$(readlink -f "$script_dir/../config") local config_file="$config_dir/config.json" - source "${script_dir}/utils/base.sh" # 检查jq是否安装 check_jq diff --git a/bin/update_domain.sh b/bin/update_domain.sh index 758f94a..36da317 100644 --- a/bin/update_domain.sh +++ b/bin/update_domain.sh @@ -1,10 +1,11 @@ #!/bin/bash +source "$(dirname "$0")/utils/base.sh" +source "$(dirname "$0")/utils/jq_util.sh" + # 修改域名 update_domain(){ local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径 - source "$script_dir/utils/jq_util.sh" - source "$script_dir/utils/base.sh" local config_file="$script_dir/../config/config.json" # 检查jq是否安装 @@ -32,5 +33,4 @@ update_domain(){ } - update_domain diff --git a/bin/update_obfs_password.sh b/bin/update_obfs_password.sh index 2e1de78..d6d2619 100644 --- a/bin/update_obfs_password.sh +++ b/bin/update_obfs_password.sh @@ -1,14 +1,12 @@ #!/bin/bash +source "$(dirname "$0")/utils/base.sh" +source "$(dirname "$0")/utils/jq_util.sh" # 更新密码的函数 update_obfs_password() { local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" local config_file="$script_dir/../config/config.json" - # 加载工具脚本 - source "$script_dir/utils/jq_util.sh" - source "$script_dir/utils/base.sh" - # 检查jq是否安装 check_jq diff --git a/bin/update_password.sh b/bin/update_password.sh index 9c93615..b1f0430 100644 --- a/bin/update_password.sh +++ b/bin/update_password.sh @@ -1,14 +1,12 @@ #!/bin/bash +source "$(dirname "$0")/utils/base.sh" +source "$(dirname "$0")/utils/jq_util.sh" # 更新密码的函数 update_password() { local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" local config_file="$script_dir/../config/config.json" - # 加载工具脚本 - source "$script_dir/utils/jq_util.sh" - source "$script_dir/utils/base.sh" - # 检查jq是否安装 check_jq