discord_peak_bot/entrypoint.sh

19 lines
490 B
Bash
Raw Permalink Normal View History

2024-08-03 11:18:28 +00:00
#!/bin/bash
# エントリーポイントスクリプト
# Voicevoxエンジンの起動
run_voicevox &
# ボットの実行
python /app/app/bot.py &
# 子プロセスVoicevoxエンジンとボットのPIDを取得
VOICEVOX_PID=$!
BOT_PID=$!
# シグナルハンドラを設定
trap "echo 'シャットダウン中...' && kill -SIGTERM $VOICEVOX_PID $BOT_PID && wait $VOICEVOX_PID $BOT_PID" SIGINT SIGTERM
# 子プロセスが終了するのを待つ
wait $VOICEVOX_PID $BOT_PID