b29d04ac2c
Self-contained HTTP service with engine, data, start script, systemd unit, and documentation. Runs independently of the Discord bot on its fixed port.
21 lines
477 B
Bash
Executable File
21 lines
477 B
Bash
Executable File
#!/bin/bash
|
|
# Start script for the DECTalk TTS server.
|
|
# Installs node dependencies on first run, then runs the server.
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
if ! command -v ffmpeg >/dev/null 2>&1; then
|
|
echo "Error: ffmpeg is not installed. Install it with: sudo apt install ffmpeg"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d node_modules ]; then
|
|
echo "Installing node dependencies..."
|
|
npm install
|
|
fi
|
|
|
|
export PORT="${PORT:-33001}"
|
|
exec node server.js
|