#!/bin/bash

# 设置路径变量
# ENV_PATH="/home/linaro/myenv/bin/activate"
SCRIPT1_PATH="/home/linaro/MenuPython_QT/uart_port.py"

# 日志文件路径
# LOG_FILE="/var/log/uart_port.log"

# # 清空日志文件
# clear_log_file() {
# 	echo "[$(date '+%y-%m-%d %H:%M:%S')] 清空日志文件" > "$LOG_FILE"
# }

# # 激活虚拟环境
# source "$ENV_PATH"

# 运行uart_port.py
python3 "$SCRIPT1_PATH"

#打印日志显示取消下列注释
# echo "[$(date '+%Y-%m-%d %H:%M:%S')] 启动 uart_port.py" >> "$LOG_FILE"
# python3 "$SCRIPT1_PATH" >> "$LOG_FILE" 2>&1
# echo "[$(date '+%Y-%m-%d %H:%M:%S')] 完成 uart_port.py" >> "$LOG_FILE"
# # 检查日志文件大小是否超过10mb并清空
# if [ $(du -m "$LOG_FILE" | cut -f1) -gt 10 ]; then
# 	clear_log_file
# fi

