diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f21be7e..d0d2680 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -2,8 +2,6 @@ # Set up logging LOGFILE="/tmp/deploy.log" -# 重定向标准输出和错误输出到日志文件 -exec &> >(tee -a "$LOGFILE") # Color definitions for output RED='\033[0;31m' @@ -13,15 +11,18 @@ NC='\033[0m' # No Color # Logging functions log_info() { - echo -e "${GREEN}[INFO]${NC} $1" | tee -a "$LOGFILE" + echo -e "${GREEN}[INFO]${NC} $1" + echo "[INFO] $1" >> "$LOGFILE" } log_warn() { - echo -e "${YELLOW}[WARN]${NC} $1" | tee -a "$LOGFILE" + echo -e "${YELLOW}[WARN]${NC} $1" + echo "[WARN] $1" >> "$LOGFILE" } log_error() { - echo -e "${RED}[ERROR]${NC} $1" | tee -a "$LOGFILE" + echo -e "${RED}[ERROR]${NC} $1" + echo "[ERROR] $1" >> "$LOGFILE" } # Check if running as root @@ -69,7 +70,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