From bb8e4cdbfafcb5b9ed9ca8c4f57e52708213976d Mon Sep 17 00:00:00 2001 From: Blallo Date: Wed, 15 Sep 2021 21:53:57 +0200 Subject: [PATCH] Generate first empty file at container startup --- .gitignore | 1 + docker-compose.yaml | 4 ++-- docker/run.sh | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 docker/run.sh diff --git a/.gitignore b/.gitignore index 9563954..d044043 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ dist/ rec/ *.egg-info/ /venv +/docker/output/* diff --git a/docker-compose.yaml b/docker-compose.yaml index 96a158a..15b65d2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,11 +7,11 @@ services: dockerfile: docker/Dockerfile.liquidsoap volumes: - ./docker/run.liq:/run.liq - - ./docker/ror.sh:/ror.sh + - ./docker/run.sh:/run.sh - rec:/rec devices: - /dev/snd:/dev/snd - entrypoint: /run.liq + entrypoint: /run.sh depends_on: - storageprepare diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 0000000..7a0175a --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -xueo pipefail + +FILEPATH="/rec/ror/$(date +%Y-%m)/$(date +%d)/rec-$(date +%Y-%m-%d-%H)-00-00.mp3" +mkdir -p $(dirname ${FILEPATH}) +if ! [[ -f ${FILEPATH} ]]; then + ffmpeg -f lavfi -i anullsrc=r=11025:cl=mono -t 3600 -acodec mp3 ${FILEPATH} +fi + +/run.liq