mirror of
git://f0xx.org/ac/ac-ms-media-transcode
synced 2026-07-29 02:18:49 +03:00
Encode-once/fanout scripts, HLS output, and single overloadable env source. Commits assets/pirate_drift.png as default watermark for cluster runs. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
709 B
Bash
Executable File
28 lines
709 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
# shellcheck disable=SC1091
|
|
source "${ROOT}/lib/common.sh"
|
|
|
|
stop_pidfile() {
|
|
local pf="$1"
|
|
[[ -f "${pf}" ]] || return 0
|
|
local pid
|
|
pid="$(cat "${pf}")"
|
|
if kill -0 "${pid}" 2>/dev/null; then
|
|
kill "${pid}" 2>/dev/null || true
|
|
sleep 1
|
|
kill -9 "${pid}" 2>/dev/null || true
|
|
fi
|
|
rm -f "${pf}"
|
|
}
|
|
|
|
stop_pidfile "${RUN_DIR}/fanout.pid"
|
|
stop_pidfile "${RUN_DIR}/encode.pid"
|
|
pkill -f "${ROOT}/bin/fanout-copy.sh" 2>/dev/null || true
|
|
pkill -f "${ROOT}/bin/encode-once.sh" 2>/dev/null || true
|
|
remove_pipe
|
|
rm -f "${ROOT}/.intro_shown" "${ROOT}/.current_source" 2>/dev/null || true
|
|
log "pipeline stopped"
|