# 检查是否已有 main.py 进程在运行 if pgrep -f "main.py --name mytts" > /dev/null then echo "Process is already running. Restarting..." # 终止已有的 main.py 进程 pkill -f "main.py --name mytts" fi export DASHSCOPE_API_KEY="sk-15b84b8c16864b20b14d4c399be4a162" # 启动新的 main.py 进程 nohup python -u main.py --name mytts &