This commit is contained in:
sindricn
2025-10-01 17:35:36 +08:00
parent d30170297c
commit 5e57b7f357
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -7,9 +7,9 @@
set -uo pipefail
# 加载公共库
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "$SCRIPT_DIR/common.sh" ]]; then
source "$SCRIPT_DIR/common.sh"
# SCRIPT_DIR 由主脚本定义,此处已移除以避免覆盖
if [[ -f "$(dirname "${BASH_SOURCE[0]}")/common.sh" ]]; then
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
else
echo "错误: 无法加载公共库" >&2
exit 1
+3 -3
View File
@@ -9,9 +9,9 @@
set -uo pipefail
# 加载公共库
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "$SCRIPT_DIR/common.sh" ]]; then
source "$SCRIPT_DIR/common.sh"
# SCRIPT_DIR 由主脚本定义,此处已移除以避免覆盖
if [[ -f "$(dirname "${BASH_SOURCE[0]}")/common.sh" ]]; then
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
else
echo "错误: 无法加载公共库" >&2
exit 1
+5 -5
View File
@@ -7,17 +7,17 @@
set -uo pipefail
# 加载公共库
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "$SCRIPT_DIR/common.sh" ]]; then
source "$SCRIPT_DIR/common.sh"
# SCRIPT_DIR 由主脚本定义,此处已移除以避免覆盖
if [[ -f "$(dirname "${BASH_SOURCE[0]}")/common.sh" ]]; then
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
else
echo "错误: 无法加载公共库" >&2
exit 1
fi
# 加载防火墙管理模块
if [[ -f "$SCRIPT_DIR/firewall-manager.sh" ]]; then
source "$SCRIPT_DIR/firewall-manager.sh"
if [[ -f "$(dirname "${BASH_SOURCE[0]}")/firewall-manager.sh" ]]; then
source "$(dirname "${BASH_SOURCE[0]}")/firewall-manager.sh"
fi
# 配置路径 (防止重复定义)