Files
ac-ms-media-transcode/bin/stop.sh
Anton Afanasyeu 5ca8a9f539 Add lab restream pipeline with pirate_drift logo and lib/env.sh.
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>
2026-07-11 15:27:24 +02:00

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"