From 91ef7e75d91cf78bf263814b00c92e4f25ce5dbb Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Sun, 28 Sep 2025 18:37:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/opt/agt/bin/application.properties | 2 +- build/opt/agt/bin/restart.sh | 10 ++++++++-- build/opt/agt/bin/shutdown.sh | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build/opt/agt/bin/application.properties b/build/opt/agt/bin/application.properties index 9410026..6947544 100644 --- a/build/opt/agt/bin/application.properties +++ b/build/opt/agt/bin/application.properties @@ -1,2 +1,2 @@ -# 设置当前服务器的IP地址或域名,用于邮箱的跳转地址、附件的存取地址等 +# 设置当前服务的IP地址或域名,用于邮箱的跳转地址、附件的存取地址等 agt.domain=http://192.168.9.50 diff --git a/build/opt/agt/bin/restart.sh b/build/opt/agt/bin/restart.sh index 84260dc..8250ed4 100644 --- a/build/opt/agt/bin/restart.sh +++ b/build/opt/agt/bin/restart.sh @@ -2,6 +2,12 @@ echo "[INFO] 开始重启服务..." -./shutdown.sh +# ==== 检查 root 权限 ==== +if [ "$(id -u)" -ne 0 ]; then + echo "请使用 root 权限运行此脚本" + exit 1 +fi -./start.sh \ No newline at end of file +sudo ./shutdown.sh + +sudo ./start.sh \ No newline at end of file diff --git a/build/opt/agt/bin/shutdown.sh b/build/opt/agt/bin/shutdown.sh index ace6fc5..f44a36d 100644 --- a/build/opt/agt/bin/shutdown.sh +++ b/build/opt/agt/bin/shutdown.sh @@ -2,6 +2,12 @@ COMPOSE_FILE="../docker/docker-compose.yml" +# ==== 检查 root 权限 ==== +if [ "$(id -u)" -ne 0 ]; then + echo "请使用 root 权限运行此脚本" + exit 1 +fi + echo "[INFO] 开始关闭服务..." # ==== 关闭服务 ==== if [ -f "$COMPOSE_FILE" ]; then