diff --git a/lib/common.sh b/lib/common.sh index 2cc6360..14cf603 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -63,7 +63,14 @@ EOF } # ---------- 环境配置(systemd service)---------- -get_service_file_local() { echo "${SCRIPT_DIR}/deploy/rust-backend-${APP_ENV}.service"; } +get_service_file_local() { + local target="${BG_TARGET:-}" + if [ -n "$target" ]; then + echo "${SCRIPT_DIR}/deploy/rust-backend-${target}.service" + else + echo "${SCRIPT_DIR}/deploy/rust-backend-${APP_ENV}.service" + fi +} check_service_file() { log_step "检查远程 systemd service 文件..."