19 lines
490 B
Bash
19 lines
490 B
Bash
#!/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
|