#!/bin/bash # {{ ansible_managed }} SCREEN_NAME=fallback-{{ mount }} if screen -S $SCREEN_NAME -Q select ; then echo "Already running; screen -S $SCREEN_NAME -X quit if you need to restart" else echo {{ filename }} - {{ mount }} screen -dmS $SCREEN_NAME ffmpeg -r 20 -re -fflags +genpts -stream_loop -1 -i /usr/share/icecast2/web/{{ filename }} -map_metadata -1 -f webm -content_type video/webm -c:a copy -c:v copy icecast://{{ icecast_emacsconf_user }}:{{ icecast_emacsconf_password }}@localhost:8001/{{ mount }} echo "Started screen; connect with screen -x $SCREEN_NAME" fi