discord_peak_bot/entrypoint.sh
2024-08-03 20:18:28 +09:00

19 lines
490 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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