Generate first empty file at container startup

This commit is contained in:
Blallo 2021-09-15 21:53:57 +02:00
parent 628e4d3d55
commit bb8e4cdbfa
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F
3 changed files with 14 additions and 2 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ dist/
rec/
*.egg-info/
/venv
/docker/output/*

View file

@ -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

11
docker/run.sh Executable file
View file

@ -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