From 96dfb198e3f49b29823010034d430614b16614c4 Mon Sep 17 00:00:00 2001 From: Tian jianyong <11429339@qq.com> Date: Fri, 20 Dec 2024 18:54:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E7=BD=B2=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index e2c2840..f21be7e 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -2,8 +2,8 @@ # Set up logging LOGFILE="/tmp/deploy.log" -exec 1> >(tee -a "$LOGFILE") -exec 2> >(tee -a "$LOGFILE" >&2) +# 重定向标准输出和错误输出到日志文件 +exec &> >(tee -a "$LOGFILE") # Color definitions for output RED='\033[0;31m' @@ -13,15 +13,15 @@ NC='\033[0m' # No Color # Logging functions log_info() { - echo -e "${GREEN}[INFO]${NC} $1" + echo -e "${GREEN}[INFO]${NC} $1" | tee -a "$LOGFILE" } log_warn() { - echo -e "${YELLOW}[WARN]${NC} $1" + echo -e "${YELLOW}[WARN]${NC} $1" | tee -a "$LOGFILE" } log_error() { - echo -e "${RED}[ERROR]${NC} $1" + echo -e "${RED}[ERROR]${NC} $1" | tee -a "$LOGFILE" } # Check if running as root @@ -69,7 +69,7 @@ if command -v getenforce &> /dev/null; then if [ "$selinux_status" = "Enforcing" ]; then log_info "Setting SELinux contexts..." - # 设置应用目录的 SELinux 上下文 + # 设置���用目录的 SELinux 上下文 log_info "Setting context for application directories..." chcon -R -t usr_t $WORK_DIR chcon -t bin_t $WORK_DIR/bin