diff options
author | Sacha Chua <sacha@sachachua.com> | 2025-01-23 08:57:37 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2025-01-23 08:57:37 -0500 |
commit | 55b95331f38663b347bbae3fd411d0fe8a845851 (patch) | |
tree | 05515a1c7cdce5804a47ec24e3e96c86f1af2d88 /roles/prerec/templates/reencode-in-screen.sh | |
parent | d38e519bfd4563190bba38d9710236c6ead8ea79 (diff) | |
download | emacsconf-ansible-55b95331f38663b347bbae3fd411d0fe8a845851.tar.xz emacsconf-ansible-55b95331f38663b347bbae3fd411d0fe8a845851.zip |
add reencode-in-screen.sh
Diffstat (limited to 'roles/prerec/templates/reencode-in-screen.sh')
-rwxr-xr-x | roles/prerec/templates/reencode-in-screen.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/prerec/templates/reencode-in-screen.sh b/roles/prerec/templates/reencode-in-screen.sh new file mode 100755 index 0000000..5c12203 --- /dev/null +++ b/roles/prerec/templates/reencode-in-screen.sh @@ -0,0 +1,16 @@ +#!/bin/bash +ORIGINAL=$1 +BASE="${ORIGINAL%--original.*}" +REENCODED="${BASE}--reencoded.webm" +SLUG=$(echo "$ORIGINAL" | perl -ne '/^emacsconf-[0-9]*-(.*?)--/ && print $1') +LOCK=".lock-$SLUG" + +if [ ! -f "$REENCODED" ]; then + if [ -f "$LOCK" ]; then + echo "$LOCK already exists, waiting for it" + else + touch "$LOCK" + screen -dmS reencode-$SLUG /bin/bash -c "reencode.sh \"$ORIGINAL\" \"$REENCODED\" && thumbnail.sh \"$MAIN\" && rm \"$LOCK\"" + echo "Processing $REENCODED in reencode-$SLUG" + fi +fi |