diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-10-25 11:13:23 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-10-25 11:13:23 -0400 |
commit | e42e761dca58557799084ceafdf2088d85fe40c5 (patch) | |
tree | 7a88d305b303b763b7ad8c849b0902b3068634bd /roles/caption/templates/inotify-process-captions.sh | |
parent | 765036da2fc05fd45693bec60ce911b01636e9be (diff) | |
download | emacsconf-ansible-e42e761dca58557799084ceafdf2088d85fe40c5.tar.xz emacsconf-ansible-e42e761dca58557799084ceafdf2088d85fe40c5.zip |
Caption daemon
Diffstat (limited to 'roles/caption/templates/inotify-process-captions.sh')
-rwxr-xr-x | roles/caption/templates/inotify-process-captions.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/caption/templates/inotify-process-captions.sh b/roles/caption/templates/inotify-process-captions.sh new file mode 100755 index 0000000..ce5f416 --- /dev/null +++ b/roles/caption/templates/inotify-process-captions.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# {{ ansible_managed }} + +# This script waits for new webm and mov files +# in the current directory (recursively) and then calls +# process-captions to process all the new files that need work. +inotifywait -r -m "{{ emacsconf_caption_dir }}" -e create -e moved_to | + while read directory action file; do + if [[ "$file" =~ .*(webm|mov)$ ]]; then + "{{ emacsconf_caption_dir }}"/process-captions.py | tee -a "{{ emacsconf_caption_dir }}/captions.log" + elif [[ "$file" =~ .*(vtt|srv2|ogg|opus)$ ]]; then + # Copy to backstage area + rsync --ignore-existing $directory/$file orga@media.emacsconf.org:/var/www/media.emacsconf.org/{{ emacsconf_year }}/backstage/ + fi + done |