#!/bin/bash


SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/ZM_4/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/GB_ZM_4/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/GB_ZM_6/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/GB_ZM_8/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/KD_ZM_4/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/KD_ZM_6/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/KD_ZM_8/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/KD_GB_ZM/APPWindow.py"
# SCRIPT2_PATH="/home/linaro/MenuPython_QT/QT5_Project/TestProject/APPWindow.py"
# 日志文件路径
#LOG_FILE="/var/log/appwindow.log"

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

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

# 运行APPWindow.py

python3 "$SCRIPT2_PATH"

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

