Initial import of transcript pipeline
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_DIR="${PROJECT_DIR:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
|
||||
UNIT_DIR="$HOME/.config/systemd/user"
|
||||
SERVICE_NAME="com.maddin.whisper-transcript-pipeline.service"
|
||||
UNIT_PATH="$UNIT_DIR/$SERVICE_NAME"
|
||||
PYTHON_BIN="${PYTHON_BIN:-$(command -v python3 || true)}"
|
||||
|
||||
if [[ -z "$PYTHON_BIN" ]]; then
|
||||
echo "python3 not found in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$UNIT_DIR"
|
||||
|
||||
cat >"$UNIT_PATH" <<EOF
|
||||
[Unit]
|
||||
Description=Whisper transcript pipeline
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=$PROJECT_DIR
|
||||
ExecStart=$PYTHON_BIN $PROJECT_DIR/transcript_pipeline.py watch
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
EOF
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now "$SERVICE_NAME"
|
||||
|
||||
echo "Installed and started $SERVICE_NAME"
|
||||
echo "If the service should survive logout, enable lingering once:"
|
||||
echo " loginctl enable-linger $USER"
|
||||
Reference in New Issue
Block a user